From 449d9a2200bf4e3d390ff26ca693f2b8dc50edea Mon Sep 17 00:00:00 2001 From: oddlama Date: Thu, 15 Dec 2022 01:54:17 +0100 Subject: [PATCH] feat: test nushell --- flake.lock | 24 ++++++------- users/common/nushell.nix | 75 +--------------------------------------- 2 files changed, 13 insertions(+), 86 deletions(-) diff --git a/flake.lock b/flake.lock index 640d05d..d727206 100644 --- a/flake.lock +++ b/flake.lock @@ -109,11 +109,11 @@ ] }, "locked": { - "lastModified": 1670513770, - "narHash": "sha256-muL74fsbGA8K8WlZSPNWddOiuBnC54kAajncX6nXrh4=", + "lastModified": 1670970889, + "narHash": "sha256-TWJo3/X3Q3r+HeX16QN4FE6ddBpGtAboymSEF+4Nnc0=", "owner": "nix-community", "repo": "home-manager", - "rev": "054d9e3187ca00479e8036dc0e92900a384f30fd", + "rev": "e412025fffdcd6219ddd21c65d9a1b90005ce508", "type": "github" }, "original": { @@ -139,11 +139,11 @@ }, "nixos-hardware": { "locked": { - "lastModified": 1670174919, - "narHash": "sha256-XdQr3BUnrvVLRFunLWrZORhwYHDG0+9jUUe0Jv1pths=", + "lastModified": 1670959777, + "narHash": "sha256-9nQJWL7S77YZERxairPLFO6TUuF1RgQmdZO6dKRCHz4=", "owner": "NixOS", "repo": "nixos-hardware", - "rev": "9d87bc030a0bf3f00e953dbf095a7d8e852dab6b", + "rev": "0fbf27af51a7c9bc68a168fdcd63513c4f100b15", "type": "github" }, "original": { @@ -154,11 +154,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1670332253, - "narHash": "sha256-O5SmhlIUt1s+vK4NXeGYqwcBIMwbBPAEZ3GHE3XT28c=", + "lastModified": 1670929434, + "narHash": "sha256-n5UBO6XBV4h3TB7FYu2yAuNQMEYOrQyKeODUwKe06ow=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "1c9ffcf70786f0966982ce0fc76ec05df2e1dec2", + "rev": "1710ed1f6f8ceb75cf7d1cf55ee0cc21760e1c7a", "type": "github" }, "original": { @@ -199,11 +199,11 @@ "nixpkgs-stable": "nixpkgs-stable" }, "locked": { - "lastModified": 1670413394, - "narHash": "sha256-M7sWqrKtOqUv9euX1t3HCxis8cPy9MNiZxQmUf0KF1o=", + "lastModified": 1671014608, + "narHash": "sha256-YLb4l6K6sD9xXBJ9GKQ98fBMrpENAadm2RQCfpC3794=", "owner": "cachix", "repo": "pre-commit-hooks.nix", - "rev": "1303a1a76e9eb074075bfe566518c413f6fc104e", + "rev": "047f96a4e11f58e17be51e57f431cf88bcb28a29", "type": "github" }, "original": { diff --git a/users/common/nushell.nix b/users/common/nushell.nix index fe8bff8..c314fa3 100644 --- a/users/common/nushell.nix +++ b/users/common/nushell.nix @@ -1,78 +1,5 @@ { - config, - pkgs, - ... -}: { - programs.zsh = { + programs.nushell = { enable = true; - enableAutosuggestions = true; - enableCompletion = true; - enableSyntaxHighlighting = true; - enableVteIntegration = pkgs.stdenv.isLinux; - autocd = true; - dotDir = ".config/zsh"; - history = { - expireDuplicatesFirst = true; - extended = true; - ignoreDups = true; - path = "${config.xdg.dataHome}/zsh/history"; - save = 10000; - share = true; - }; - envExtra = '' - export LESSHISTFILE="${config.xdg.dataHome}/less_history" - export CARGO_HOME="${config.xdg.cacheHome}/cargo" - ''; - initExtra = '' - nix-closure-size() { - nix-store -q --size $(nix-store -qR $(${pkgs.coreutils}/bin/readlink -e $1) ) | - ${pkgs.gawk}/bin/gawk '{ a+=$1 } END { print a }' | - ${pkgs.coreutils}/bin/numfmt --to=iec-i - } - bindkey "$${terminfo[khome]}" beginning-of-line - bindkey "$${terminfo[kend]}" end-of-line - bindkey "$${terminfo[kdch1]}" delete-char - bindkey '\eOA' history-substring-search-up - bindkey '\eOB' history-substring-search-down - bindkey "^[[A" history-substring-search-up - bindkey "^[[B" history-substring-search-down - bindkey "$$terminfo[kcuu1]" history-substring-search-up - bindkey "$$terminfo[kcud1]" history-substring-search-down - bindkey "^[[1;5C" forward-word - bindkey "^[[1;3C" forward-word - bindkey "^[[1;5D" backward-word - bindkey "^[[1;3D" backward-word - bindkey -s "^O" 'fzf | xargs -r $VISUAL^M' - bindkey -rpM viins '^[^[' - KEYTIMEOUT=1 - ${pkgs.any-nix-shell}/bin/any-nix-shell zsh | source /dev/stdin - ''; - sessionVariables = { - RPROMPT = ""; - }; - plugins = [ - { - # https://github.com/hlissner/zsh-autopair - name = "zsh-autopair"; - file = "zsh-autopair.plugin.zsh"; - src = pkgs.fetchFromGitHub { - owner = "hlissner"; - repo = "zsh-autopair"; - rev = "34a8bca0c18fcf3ab1561caef9790abffc1d3d49"; - sha256 = "1h0vm2dgrmb8i2pvsgis3lshc5b0ad846836m62y8h3rdb3zmpy1"; - }; - } - { - # https://github.com/zsh-users/zsh-history-substring-search - name = "zsh-history-substring-search"; - file = "zsh-history-substring-search.plugin.zsh"; - src = pkgs.fetchFromGitHub { - owner = "zsh-users"; - repo = "zsh-history-substring-search"; - rev = "0f80b8eb3368b46e5e573c1d91ae69eb095db3fb"; - sha256 = "0y8va5kc2ram38hbk2cibkk64ffrabfv1sh4xm7pjspsba9n5p1y"; - }; - } - ]; }; }