diff --git a/home/shell/default.nix b/home/shell/default.nix index 34e29b6..c19208b 100644 --- a/home/shell/default.nix +++ b/home/shell/default.nix @@ -1,7 +1,14 @@ { config, pkgs, ... }: { - imports = [ ./bash.nix ./zsh.nix ./starship.nix ./kitty.nix ./direnv.nix ]; + imports = [ + ./bash.nix + ./zsh.nix + ./nushell.nix + ./starship.nix + ./kitty.nix + ./direnv.nix + ]; programs.fzf = { enable = true; }; diff --git a/home/shell/nushell.nix b/home/shell/nushell.nix new file mode 100644 index 0000000..bd2d9b6 --- /dev/null +++ b/home/shell/nushell.nix @@ -0,0 +1,43 @@ +{ config, pkgs, ... }: + +let + shellAliases = import ./aliases.nix; + aliasesStr = builtins.concatStringsSep "\n" + (pkgs.lib.mapAttrsToList (k: v: "alias ${k} = ${v}") shellAliases); + + nu_scripts = pkgs.fetchFromGitHub { + owner = "nushell"; + repo = "nu_scripts"; + rev = "ebdab3dea34f7776c937497a67357f913b0c1c54"; + hash = "sha256-Vh3WU0oNlo6HZWwhlVt5sQJa5214rVClh9gTLR3rFDg="; + }; +in { + programs.nushell = { + enable = true; + package = pkgs.unstable.nushell; + configFile.text = '' + let-env config = { + edit_mode: "vi" + show_banner: false + } + + ${aliasesStr} + + use ${nu_scripts}/ssh/ssh.nu * + use ${nu_scripts}/git/git.nu * + use ${nu_scripts}/docker/docker.nu * + use ${nu_scripts}/custom-completions/git/git-completions.nu * + use ${nu_scripts}/custom-completions/nix/nix-completions.nu * + use ${nu_scripts}/custom-completions/cargo/cargo-completions.nu * + # use ${nu_scripts}/custom-completions/npm/npm-completions.nu * # TODO incomplete + use ${nu_scripts}/custom-completions/auto-generate/completions/wget.nu * + # use ${nu_scripts}/custom-completions/auto-generate/completions/tar.nu * # TODO broken + use ${nu_scripts}/custom-completions/auto-generate/completions/zstd.nu * + use ${nu_scripts}/custom-completions/auto-generate/completions/unzstd.nu * + use ${nu_scripts}/custom-completions/auto-generate/completions/npm.nu * + use ${nu_scripts}/custom-completions/auto-generate/completions/dotnet.nu * + use ${nu_scripts}/custom-completions/auto-generate/completions/terraform.nu * + ''; + envFile.text = ""; + }; +} diff --git a/home/shell/starship.nix b/home/shell/starship.nix index bae0983..e8dd3a3 100644 --- a/home/shell/starship.nix +++ b/home/shell/starship.nix @@ -14,5 +14,7 @@ # kitty/neovim don't play well with multi-width emojis nix_shell.symbol = " "; }; + # @TODO broken in nixos-22.11 + enableNushellIntegration = false; }; }