diff --git a/home/config/nil/home.nix b/home/config/nil/home.nix index 8f9787a..9a2dc4c 100644 --- a/home/config/nil/home.nix +++ b/home/config/nil/home.nix @@ -30,12 +30,6 @@ in { home.stateVersion = "24.11"; home.enableNixpkgsReleaseCheck = false; - home.activation = { - fish = lib.hm.dag.entryAfter ["writeBoundary"] '' - run ${lib.getExe config.programs.fish.package} -c 'set -U fish_greeting' - ''; - }; - home.packages = with pkgs; [ # Terminfo kitty.terminfo @@ -306,6 +300,51 @@ in { ''; }; + programs.nushell = { + enable = true; + envFile.text = '' + load-env { + PROMPT_COMMAND: { + let dir = match (do --ignore-shell-errors { $env.PWD | path relative-to $nu.home-path }) { + null => $env.PWD + "" => '~' + $relative_pwd => ([~ $relative_pwd] | path join) + } + + [ + (if (is-admin) { ansi red_bold } else { ansi green_bold }) + (sys host | get hostname) + (char space) + (ansi blue_bold) + ($dir | path split | last) + (ansi reset) + (char space) + ] | str join + } + + PROMPT_COMMAND_RIGHT: { + let duration = $env.CMD_DURATION_MS | into int + + if $duration >= 2000 { + [ (ansi light_red) ($duration | into duration --unit ms) ] | str join + } + } + + PROMPT_INDICATOR: { "› " } + + SSH_AUTH_SOCK: $"($env.XDG_RUNTIME_DIR)/ssh-agent" + TMPDIR: $"($env.XDG_RUNTIME_DIR)/tmp" + } + ''; + + configFile.text = '' + $env.config = { + show_banner: false + use_kitty_protocol: true + }; + ''; + }; + services.ssh-agent.enable = true; systemd.user.tmpfiles.rules = [ diff --git a/nixos/module/users.nix b/nixos/module/users.nix index 69306b1..2a5914c 100644 --- a/nixos/module/users.nix +++ b/nixos/module/users.nix @@ -14,7 +14,6 @@ in { (pkg: builtins.elem (lib.getName pkg) [ "obsidian" ]); programs.dconf.enable = lib.mkIf graphical true; - programs.fish.enable = true; services.udev.packages = [ (pkgs.writeTextDir "/etc/udev/rules.d/98-user-power-supply.rules" '' @@ -48,7 +47,7 @@ in { users.users.nil = { isNormalUser = true; - shell = config.programs.fish.package; + shell = pkgs.nushell; extraGroups = [ "wheel" ]; openssh.authorizedKeys.keys = [ "sk-ssh-ed25519@openssh.com AAAAGnNrLXNzaC1lZDI1NTE5QG9wZW5zc2guY29tAAAAICczPHRwY9MAwDGlcB0QgMOJjcpLJhVU3covrW9RBS62AAAABHNzaDo= primary"