diff --git a/configuration.nix b/configuration.nix index d821d67..790cb69 100644 --- a/configuration.nix +++ b/configuration.nix @@ -93,7 +93,7 @@ in { isNormalUser = true; extraGroups = [ "wheel" "wireshark" "podman" ]; # Enable ‘sudo’ for the user. - shell = pkgs.fish; + shell = pkgs.nushell; home = "/home/allen"; packages = with pkgs; [ tree ]; }; diff --git a/home.nix b/home.nix index 008ba34..72d226c 100644 --- a/home.nix +++ b/home.nix @@ -9,6 +9,7 @@ ./modules/home/starship.nix ./modules/home/alacritty.nix ./modules/home/bash.nix + ./modules/home/nushell.nix ]; home.username = "allen"; diff --git a/modules/home/nushell.nix b/modules/home/nushell.nix new file mode 100644 index 0000000..d85cd78 --- /dev/null +++ b/modules/home/nushell.nix @@ -0,0 +1,37 @@ +{ ... }: { + programs = { + nushell = { + enable = true; + configFile.source = ../../shell/config.nu; + shellAliases = { vi = "nvim"; }; + extraConfig = '' + let carapace_completer = {|spans| + carapace $spans.0 nushell ...$spans | from json + } + $env.config = { + show_banner: false, + completions: { + case_sensitive: false # case-sensitive completions + quick: true # set to false to prevent auto-selecting completions + partial: true # set to false to prevent partial filling of the prompt + algorithm: "fuzzy" # prefix or fuzzy + external: { + # set to false to prevent nushell looking into $env.PATH to find more suggestions + enable: true + # set to lower can improve completion performance at the cost of omitting some options + max_results: 100 + completer: $carapace_completer # check 'carapace_completer' + } + } + } + $env.PATH = ($env.PATH | + split row (char esep) | + prepend /home/myuser/.apps | + append /usr/bin/env + ) + ''; + }; + carapace.enable = true; + carapace.enableNushellIntegration = true; + }; +} diff --git a/pkgs/util.nix b/pkgs/util.nix index 635854b..0f28667 100644 --- a/pkgs/util.nix +++ b/pkgs/util.nix @@ -5,6 +5,7 @@ with pkgs; [ neofetch nnn # terminal file manager + nushell # archives zip @@ -73,4 +74,5 @@ with pkgs; [ airspyhf pstree gptfdisk + nix-search ] diff --git a/shell/config.nu b/shell/config.nu new file mode 100644 index 0000000..e69de29