1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-12-06 09:01:04 +01:00

nix-your-shell: build-time nushell config generation

This commit is contained in:
jaredmontoya 2025-03-21 20:13:56 +01:00 committed by Austin Horstman
parent dde05a0b10
commit 287cbbbf80
2 changed files with 16 additions and 20 deletions

View file

@ -25,22 +25,21 @@ in {
programs = {
fish.interactiveShellInit = lib.mkIf cfg.enableFishIntegration ''
${cfg.package}/bin/nix-your-shell fish | source
${lib.getExe cfg.package} fish | source
'';
nushell = lib.mkIf cfg.enableNushellIntegration {
extraEnv = ''
mkdir ${config.xdg.cacheHome}/nix-your-shell
${cfg.package}/bin/nix-your-shell nu | save --force ${config.xdg.cacheHome}/nix-your-shell/init.nu
'';
extraConfig = ''
source ${config.xdg.cacheHome}/nix-your-shell/init.nu
source ${
pkgs.runCommand "nix-your-shell-nushell-config" { } ''
${lib.getExe cfg.package} nu >> "$out"
''
}
'';
};
zsh.initContent = lib.mkIf cfg.enableZshIntegration ''
${cfg.package}/bin/nix-your-shell zsh | source /dev/stdin
${lib.getExe cfg.package} zsh | source /dev/stdin
'';
};
};