diff options
| author | seth <[email protected]> | 2024-10-27 02:27:42 -0400 |
|---|---|---|
| committer | seth <[email protected]> | 2024-10-27 02:27:42 -0400 |
| commit | 87e5274c0ad37baf3130e090f6645935e9c17e11 (patch) | |
| tree | 6e995f0bba34861c114a540319f0f9d76e91410b /users/seth/programs/nu.nix | |
| parent | d088ba5731cca3c552584b9eb2e212c8fd624b58 (diff) | |
seth: merge shell modules with regular programs
Diffstat (limited to 'users/seth/programs/nu.nix')
| -rw-r--r-- | users/seth/programs/nu.nix | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/users/seth/programs/nu.nix b/users/seth/programs/nu.nix new file mode 100644 index 0000000..89a6803 --- /dev/null +++ b/users/seth/programs/nu.nix @@ -0,0 +1,45 @@ +{ + config, + lib, + pkgs, + ... +}: +let + cfg = config.seth.programs.nushell; + theme = "catppuccin-${config.catppuccin.flavor}"; +in +{ + options.seth.programs.nushell = { + enable = lib.mkEnableOption "Nushell configuration"; + }; + + config = lib.mkIf cfg.enable { + programs = { + nushell = { + enable = true; + + configFile.text = '' + def "nixgc" [] { + sudo nix-collect-garbage -d; nix-collect-garbage -d + } + ''; + + envFile.text = '' + use ${pkgs.nu_scripts}/share/nu_scripts/themes/nu-themes/${theme}.nu + $env.config.color_config = (${theme}) + ''; + + inherit (config.home) shellAliases; + }; + + bash.initExtra = lib.mkAfter '' + if [[ $(ps --no-header --pid=$PPID --format=comm) != "nu" && -z ''${BASH_EXECUTION_STRING} ]]; then + exec ${lib.getExe config.programs.nushell.package} + fi + ''; + + # builtin `ls` is good here! + eza.enable = lib.mkForce false; + }; + }; +} |
