From 96cf7faf35316018db9dad89bd943ae7d435a0c5 Mon Sep 17 00:00:00 2001 From: jaredmontoya <49511278+jaredmontoya@users.noreply.github.com> Date: Fri, 21 Mar 2025 20:17:17 +0100 Subject: [PATCH 1/7] starship: build-time nushell config generation --- modules/programs/starship.nix | 23 ++++++++----------- .../starship/fish_with_interactive.nix | 2 +- .../starship/fish_without_interactive.nix | 2 +- 3 files changed, 11 insertions(+), 16 deletions(-) diff --git a/modules/programs/starship.nix b/modules/programs/starship.nix index c3b2a61ae..459f5e0d5 100644 --- a/modules/programs/starship.nix +++ b/modules/programs/starship.nix @@ -8,8 +8,6 @@ let tomlFormat = pkgs.formats.toml { }; - starshipCmd = "${config.home.profileDirectory}/bin/starship"; - initFish = if cfg.enableInteractive then "interactiveShellInit" else "shellInitLast"; in { @@ -102,26 +100,26 @@ in { programs.bash.initExtra = mkIf cfg.enableBashIntegration '' if [[ $TERM != "dumb" ]]; then - eval "$(${starshipCmd} init bash --print-full-init)" + eval "$(${lib.getExe cfg.package} init bash --print-full-init)" fi ''; programs.zsh.initContent = mkIf cfg.enableZshIntegration '' if [[ $TERM != "dumb" ]]; then - eval "$(${starshipCmd} init zsh)" + eval "$(${lib.getExe cfg.package} init zsh)" fi ''; programs.fish.${initFish} = mkIf cfg.enableFishIntegration '' if test "$TERM" != "dumb" - ${starshipCmd} init fish | source + ${lib.getExe cfg.package} init fish | source ${lib.optionalString cfg.enableTransience "enable_transience"} end ''; programs.ion.initExtra = mkIf cfg.enableIonIntegration '' if test $TERM != "dumb" - eval $(${starshipCmd} init ion) + eval $(${lib.getExe cfg.package} init ion) end ''; @@ -130,15 +128,12 @@ in { # conditionally setting (global) environment variables, which is why the # check for terminal compatibility (as seen above for the other shells) is # not done here. - extraEnv = '' - let starship_cache = "${config.xdg.cacheHome}/starship" - if not ($starship_cache | path exists) { - mkdir $starship_cache - } - ${starshipCmd} init nu | save --force ${config.xdg.cacheHome}/starship/init.nu - ''; extraConfig = '' - use ${config.xdg.cacheHome}/starship/init.nu + use ${ + pkgs.runCommand "starship-nushell-config" { } '' + ${lib.getExe cfg.package} init nu >> "$out" + '' + } ''; }; }; diff --git a/tests/modules/programs/starship/fish_with_interactive.nix b/tests/modules/programs/starship/fish_with_interactive.nix index 1fdc3d01c..fdb478179 100644 --- a/tests/modules/programs/starship/fish_with_interactive.nix +++ b/tests/modules/programs/starship/fish_with_interactive.nix @@ -10,7 +10,7 @@ export GOT="$(tail -n 5 `_abs home-files/.config/fish/config.fish`)" export NOT_EXPECTED=" if test \"\$TERM\" != dumb - /home/hm-user/.nix-profile/bin/starship init fish | source + @starship@/bin/starship init fish | source end" diff --git a/tests/modules/programs/starship/fish_without_interactive.nix b/tests/modules/programs/starship/fish_without_interactive.nix index 52150715e..76e06b0d0 100644 --- a/tests/modules/programs/starship/fish_without_interactive.nix +++ b/tests/modules/programs/starship/fish_without_interactive.nix @@ -14,7 +14,7 @@ export GOT="$(tail -n 5 `_abs home-files/.config/fish/config.fish`)" export EXPECTED=" if test \"\$TERM\" != dumb - /home/hm-user/.nix-profile/bin/starship init fish | source + @starship@/bin/starship init fish | source end" From 672186591e0b7e7e6070cbfb3d0913d110dce3fc Mon Sep 17 00:00:00 2001 From: jaredmontoya <49511278+jaredmontoya@users.noreply.github.com> Date: Fri, 21 Mar 2025 20:16:45 +0100 Subject: [PATCH 2/7] zoxide: build-time nushell config generation --- modules/programs/zoxide.nix | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/modules/programs/zoxide.nix b/modules/programs/zoxide.nix index 8509a3dc6..4386b8c48 100644 --- a/modules/programs/zoxide.nix +++ b/modules/programs/zoxide.nix @@ -45,29 +45,25 @@ in { programs.bash.initExtra = lib.mkIf cfg.enableBashIntegration (lib.mkOrder 2000 '' - eval "$(${cfg.package}/bin/zoxide init bash ${cfgOptions})" + eval "$(${lib.getExe cfg.package} init bash ${cfgOptions})" ''); programs.zsh.initContent = lib.mkIf cfg.enableZshIntegration (lib.mkOrder 2000 '' - eval "$(${cfg.package}/bin/zoxide init zsh ${cfgOptions})" + eval "$(${lib.getExe cfg.package} init zsh ${cfgOptions})" ''); programs.fish.interactiveShellInit = lib.mkIf cfg.enableFishIntegration '' - ${cfg.package}/bin/zoxide init fish ${cfgOptions} | source + ${lib.getExe cfg.package} init fish ${cfgOptions} | source ''; programs.nushell = lib.mkIf cfg.enableNushellIntegration { - extraEnv = '' - let zoxide_cache = "${config.xdg.cacheHome}/zoxide" - if not ($zoxide_cache | path exists) { - mkdir $zoxide_cache - } - ${cfg.package}/bin/zoxide init nushell ${cfgOptions} | - save --force ${config.xdg.cacheHome}/zoxide/init.nu - ''; extraConfig = '' - source ${config.xdg.cacheHome}/zoxide/init.nu + source ${ + pkgs.runCommand "zoxide-nushell-config" { } '' + ${lib.getExe cfg.package} init nushell ${cfgOptions} >> "$out" + '' + } ''; }; }; From 17aea8e06b58b9d9dfa97e9f630ace6e7d7e8a06 Mon Sep 17 00:00:00 2001 From: jaredmontoya <49511278+jaredmontoya@users.noreply.github.com> Date: Fri, 21 Mar 2025 20:16:01 +0100 Subject: [PATCH 3/7] atuin: build-time nushell config generation --- modules/programs/atuin.nix | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/modules/programs/atuin.nix b/modules/programs/atuin.nix index ccb4347fa..19f469fe2 100644 --- a/modules/programs/atuin.nix +++ b/modules/programs/atuin.nix @@ -125,17 +125,12 @@ in { ''; programs.nushell = mkIf cfg.enableNushellIntegration { - extraEnv = '' - let atuin_cache = "${config.xdg.cacheHome}/atuin" - if not ($atuin_cache | path exists) { - mkdir $atuin_cache - } - ${ - lib.getExe cfg.package - } init nu ${flagsStr} | save --force ${config.xdg.cacheHome}/atuin/init.nu - ''; extraConfig = '' - source ${config.xdg.cacheHome}/atuin/init.nu + source ${ + pkgs.runCommand "atuin-nushell-config" { } '' + ${lib.getExe cfg.package} init nu ${flagsStr} >> "$out" + '' + } ''; }; } From ba300a20629265585f9c9a0e9bf140ac618289cb Mon Sep 17 00:00:00 2001 From: jaredmontoya <49511278+jaredmontoya@users.noreply.github.com> Date: Fri, 21 Mar 2025 20:15:27 +0100 Subject: [PATCH 4/7] carapace: build-time nushell config generation --- modules/programs/carapace.nix | 45 +++++++++------------ tests/modules/programs/carapace/nushell.nix | 9 ++--- 2 files changed, 22 insertions(+), 32 deletions(-) diff --git a/modules/programs/carapace.nix b/modules/programs/carapace.nix index d07cb6bd0..df5fa3005 100644 --- a/modules/programs/carapace.nix +++ b/modules/programs/carapace.nix @@ -1,20 +1,16 @@ { config, pkgs, lib, ... }: let - - inherit (lib) - mkEnableOption mkPackageOption mkIf pipe fileContents splitString; cfg = config.programs.carapace; - bin = cfg.package + "/bin/carapace"; - + bin = lib.getExe cfg.package; in { meta.maintainers = with lib.maintainers; [ weathercold bobvanderlinden ]; options.programs.carapace = { - enable = - mkEnableOption "carapace, a multi-shell multi-command argument completer"; + enable = lib.mkEnableOption + "carapace, a multi-shell multi-command argument completer"; - package = mkPackageOption pkgs "carapace" { }; + package = lib.mkPackageOption pkgs "carapace" { }; enableBashIntegration = lib.hm.shell.mkBashIntegrationOption { inherit config; }; @@ -29,39 +25,34 @@ in { lib.hm.shell.mkZshIntegrationOption { inherit config; }; }; - config = mkIf cfg.enable { + config = lib.mkIf cfg.enable { home.packages = [ cfg.package ]; programs = { - bash.initExtra = mkIf cfg.enableBashIntegration '' + bash.initExtra = lib.mkIf cfg.enableBashIntegration '' source <(${bin} _carapace bash) ''; - zsh.initContent = mkIf cfg.enableZshIntegration '' + zsh.initContent = lib.mkIf cfg.enableZshIntegration '' source <(${bin} _carapace zsh) ''; - fish.interactiveShellInit = mkIf cfg.enableFishIntegration '' + fish.interactiveShellInit = lib.mkIf cfg.enableFishIntegration '' ${bin} _carapace fish | source ''; - nushell = mkIf cfg.enableNushellIntegration { - # Note, the ${"$"} below is a work-around because xgettext otherwise - # interpret it as a Bash i18n string. - extraEnv = '' - let carapace_cache = "${config.xdg.cacheHome}/carapace" - if not ($carapace_cache | path exists) { - mkdir $carapace_cache - } - ${bin} _carapace nushell | save -f ${"$"}"($carapace_cache)/init.nu" - ''; + nushell = lib.mkIf cfg.enableNushellIntegration { extraConfig = '' - source ${config.xdg.cacheHome}/carapace/init.nu + source ${ + pkgs.runCommand "carapace-nushell-config" { } '' + ${bin} _carapace nushell >> "$out" + '' + } ''; }; }; - xdg.configFile = mkIf (config.programs.fish.enable + xdg.configFile = lib.mkIf (config.programs.fish.enable && cfg.enableFishIntegration && lib.versionOlder config.programs.fish.package.version "4.0.0") ( # Convert the entries from `carapace --list` to empty @@ -84,9 +75,9 @@ in { } '' ${bin} --list > $out ''; - in pipe carapaceListFile [ - fileContents - (splitString "\n") + in lib.pipe carapaceListFile [ + lib.fileContents + (lib.splitString "\n") (map (builtins.match "^([a-z0-9-]+) .*")) (builtins.filter (match: match != null && (builtins.length match) > 0)) diff --git a/tests/modules/programs/carapace/nushell.nix b/tests/modules/programs/carapace/nushell.nix index d97fa8985..285e902e5 100644 --- a/tests/modules/programs/carapace/nushell.nix +++ b/tests/modules/programs/carapace/nushell.nix @@ -1,4 +1,4 @@ -{ pkgs, config, ... }: +{ lib, pkgs, realPkgs, config, ... }: { programs = { @@ -6,17 +6,16 @@ nushell.enable = true; }; + _module.args.pkgs = lib.mkForce realPkgs; + nmt.script = let configDir = if pkgs.stdenv.isDarwin && !config.xdg.enable then "home-files/Library/Application Support/nushell" else "home-files/.config/nushell"; in '' - assertFileExists "${configDir}/env.nu" - assertFileRegex "${configDir}/env.nu" \ - '/nix/store/.*carapace.*/bin/carapace _carapace nushell \| save -f \$"(\$carapace_cache)/init\.nu"' assertFileExists "${configDir}/config.nu" assertFileRegex "${configDir}/config.nu" \ - 'source /.*/\.cache/carapace/init\.nu' + 'source /nix/store/[^/]*-carapace-nushell-config' ''; } From eed2111581df4253f12ed85a0a008bd03a9513e6 Mon Sep 17 00:00:00 2001 From: jaredmontoya <49511278+jaredmontoya@users.noreply.github.com> Date: Fri, 21 Mar 2025 20:13:56 +0100 Subject: [PATCH 5/7] nix-your-shell: build-time nushell config generation --- modules/programs/nix-your-shell.nix | 15 +++++++------ .../programs/nix-your-shell/enable-shells.nix | 21 ++++++++----------- 2 files changed, 16 insertions(+), 20 deletions(-) diff --git a/modules/programs/nix-your-shell.nix b/modules/programs/nix-your-shell.nix index c39d3a501..287605482 100644 --- a/modules/programs/nix-your-shell.nix +++ b/modules/programs/nix-your-shell.nix @@ -31,22 +31,21 @@ in { programs = { fish.interactiveShellInit = mkIf cfg.enableFishIntegration '' - ${cfg.package}/bin/nix-your-shell fish | source + ${lib.getExe cfg.package} fish | source ''; nushell = 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 = mkIf cfg.enableZshIntegration '' - ${cfg.package}/bin/nix-your-shell zsh | source /dev/stdin + ${lib.getExe cfg.package} zsh | source /dev/stdin ''; }; }; diff --git a/tests/modules/programs/nix-your-shell/enable-shells.nix b/tests/modules/programs/nix-your-shell/enable-shells.nix index 8c136da4d..cb242aed1 100644 --- a/tests/modules/programs/nix-your-shell/enable-shells.nix +++ b/tests/modules/programs/nix-your-shell/enable-shells.nix @@ -1,4 +1,4 @@ -{ pkgs, config, ... }: +{ lib, pkgs, realPkgs, config, ... }: { programs = { @@ -13,6 +13,8 @@ zsh.enable = true; }; + _module.args.pkgs = lib.mkForce realPkgs; + nmt.script = let nushellConfigDir = if pkgs.stdenv.isDarwin && !config.xdg.enable then "home-files/Library/Application Support/nushell" @@ -20,23 +22,18 @@ "home-files/.config/nushell"; in '' assertFileExists home-files/.config/fish/config.fish - assertFileContains \ + assertFileRegex \ home-files/.config/fish/config.fish \ - '@nix-your-shell@/bin/nix-your-shell fish | source' + '/nix/store/[^/]*-nix-your-shell-[^/]*/bin/nix-your-shell fish | source' assertFileExists ${nushellConfigDir}/config.nu - assertFileContains \ + assertFileRegex \ ${nushellConfigDir}/config.nu \ - 'source ${config.xdg.cacheHome}/nix-your-shell/init.nu' - - assertFileExists ${nushellConfigDir}/env.nu - assertFileContains \ - ${nushellConfigDir}/env.nu \ - '@nix-your-shell@/bin/nix-your-shell nu | save --force ${config.xdg.cacheHome}/nix-your-shell/init.nu' + 'source /nix/store/[^/]*-nix-your-shell-nushell-config' assertFileExists home-files/.zshrc - assertFileContains \ + assertFileRegex \ home-files/.zshrc \ - '@nix-your-shell@/bin/nix-your-shell zsh | source /dev/stdin' + '/nix/store/[^/]*-nix-your-shell-[^/]*/bin/nix-your-shell zsh | source /dev/stdin' ''; } From 467dbe9e2a9bdc542e929e6a6a9f360781ebd0ff Mon Sep 17 00:00:00 2001 From: jaredmontoya <49511278+jaredmontoya@users.noreply.github.com> Date: Fri, 21 Mar 2025 20:11:07 +0100 Subject: [PATCH 6/7] oh-my-posh: build-time nushell config generation --- modules/programs/oh-my-posh.nix | 21 +++++++++---------- tests/modules/programs/oh-my-posh/nushell.nix | 16 ++++---------- 2 files changed, 14 insertions(+), 23 deletions(-) diff --git a/modules/programs/oh-my-posh.nix b/modules/programs/oh-my-posh.nix index dc666afb0..39050e196 100644 --- a/modules/programs/oh-my-posh.nix +++ b/modules/programs/oh-my-posh.nix @@ -68,27 +68,26 @@ in { }; programs.bash.initExtra = mkIf cfg.enableBashIntegration '' - eval "$(${cfg.package}/bin/oh-my-posh init bash ${configArgument})" + eval "$(${lib.getExe cfg.package} init bash ${configArgument})" ''; programs.zsh.initContent = mkIf cfg.enableZshIntegration '' - eval "$(${cfg.package}/bin/oh-my-posh init zsh ${configArgument})" + eval "$(${lib.getExe cfg.package} init zsh ${configArgument})" ''; programs.fish.shellInit = mkIf cfg.enableFishIntegration '' - ${cfg.package}/bin/oh-my-posh init fish ${configArgument} | source + ${lib.getExe cfg.package} init fish ${configArgument} | source ''; programs.nushell = mkIf cfg.enableNushellIntegration { - extraEnv = '' - let oh_my_posh_cache = "${config.xdg.cacheHome}/oh-my-posh" - if not ($oh_my_posh_cache | path exists) { - mkdir $oh_my_posh_cache - } - ${cfg.package}/bin/oh-my-posh init nu ${configArgument} --print | save --force ${config.xdg.cacheHome}/oh-my-posh/init.nu - ''; extraConfig = '' - source ${config.xdg.cacheHome}/oh-my-posh/init.nu + source ${ + pkgs.runCommand "oh-my-posh-nushell-config" { } '' + ${ + lib.getExe cfg.package + } init nu ${configArgument} --print >> "$out" + '' + } ''; }; }; diff --git a/tests/modules/programs/oh-my-posh/nushell.nix b/tests/modules/programs/oh-my-posh/nushell.nix index 2e5079e06..ec88df50f 100644 --- a/tests/modules/programs/oh-my-posh/nushell.nix +++ b/tests/modules/programs/oh-my-posh/nushell.nix @@ -1,4 +1,4 @@ -{ pkgs, config, ... }: +{ lib, pkgs, realPkgs, config, ... }: { programs = { @@ -10,25 +10,17 @@ }; }; + _module.args.pkgs = lib.mkForce realPkgs; + nmt.script = let configFile = if pkgs.stdenv.isDarwin && !config.xdg.enable then "home-files/Library/Application Support/nushell/config.nu" else "home-files/.config/nushell/config.nu"; - - envFile = if pkgs.stdenv.isDarwin && !config.xdg.enable then - "home-files/Library/Application Support/nushell/env.nu" - else - "home-files/.config/nushell/env.nu"; in '' - assertFileExists "${envFile}" - assertFileRegex \ - "${envFile}" \ - '/bin/oh-my-posh init nu --config .*--print \| save --force /.*/home-files/\.cache/oh-my-posh/init\.nu' - assertFileExists "${configFile}" assertFileRegex \ "${configFile}" \ - 'source /.*/\.cache/oh-my-posh/init\.nu' + 'source /nix/store/[^/]*-oh-my-posh-nushell-config' ''; } From 3e54b76507613b1f143a115fcbf44c160ce662a8 Mon Sep 17 00:00:00 2001 From: jaredmontoya <49511278+jaredmontoya@users.noreply.github.com> Date: Thu, 20 Mar 2025 01:15:51 +0100 Subject: [PATCH 7/7] pay-respects: allow setting custom options --- modules/programs/pay-respects.nix | 48 ++++++++++--------- .../pay-respects/integration-disabled.nix | 12 +++-- .../pay-respects/integration-enabled.nix | 20 ++++---- 3 files changed, 46 insertions(+), 34 deletions(-) diff --git a/modules/programs/pay-respects.nix b/modules/programs/pay-respects.nix index 302d1b125..cfbd3dc10 100644 --- a/modules/programs/pay-respects.nix +++ b/modules/programs/pay-respects.nix @@ -1,16 +1,24 @@ { config, lib, pkgs, ... }: let - inherit (lib) mkEnableOption mkPackageOption getExe optionalString mkIf; - cfg = config.programs.pay-respects; - payRespectsCmd = getExe cfg.package; + payRespectsCmd = lib.getExe cfg.package; + cfgOptions = lib.concatStringsSep " " cfg.options; in { meta.maintainers = [ lib.hm.maintainers.ALameLlama ]; options.programs.pay-respects = { - enable = mkEnableOption "pay-respects"; + enable = lib.mkEnableOption "pay-respects"; - package = mkPackageOption pkgs "pay-respects" { }; + package = lib.mkPackageOption pkgs "pay-respects" { }; + + options = lib.mkOption { + type = lib.types.listOf lib.types.str; + default = [ "--alias" ]; + example = [ "--alias" "f" ]; + description = '' + List of options to pass to pay-respects . + ''; + }; enableBashIntegration = lib.hm.shell.mkBashIntegrationOption { inherit config; }; @@ -25,32 +33,28 @@ in { lib.hm.shell.mkZshIntegrationOption { inherit config; }; }; - config = mkIf cfg.enable { + config = lib.mkIf cfg.enable { home.packages = [ cfg.package ]; programs = { - bash.initExtra = '' - ${optionalString cfg.enableBashIntegration '' - eval "$(${payRespectsCmd} bash --alias)" - ''} + bash.initExtra = lib.mkIf cfg.enableBashIntegration '' + eval "$(${payRespectsCmd} bash ${cfgOptions})" ''; - zsh.initContent = '' - ${optionalString cfg.enableZshIntegration '' - eval "$(${payRespectsCmd} zsh --alias)" - ''} + zsh.initContent = lib.mkIf cfg.enableZshIntegration '' + eval "$(${payRespectsCmd} zsh ${cfgOptions})" ''; - fish.interactiveShellInit = '' - ${optionalString cfg.enableFishIntegration '' - ${payRespectsCmd} fish --alias | source - ''} + fish.interactiveShellInit = lib.mkIf cfg.enableFishIntegration '' + ${payRespectsCmd} fish ${cfgOptions} | source ''; - nushell.extraConfig = '' - ${optionalString cfg.enableNushellIntegration '' - ${payRespectsCmd} nushell --alias [] - ''} + nushell.extraConfig = lib.mkIf cfg.enableNushellIntegration '' + source ${ + pkgs.runCommand "pay-respects-nushell-config" { } '' + ${payRespectsCmd} nushell ${cfgOptions} >> "$out" + '' + } ''; }; }; diff --git a/tests/modules/programs/pay-respects/integration-disabled.nix b/tests/modules/programs/pay-respects/integration-disabled.nix index a6453e354..f973fdbdc 100644 --- a/tests/modules/programs/pay-respects/integration-disabled.nix +++ b/tests/modules/programs/pay-respects/integration-disabled.nix @@ -1,3 +1,5 @@ +{ lib, realPkgs, ... }: + { programs = { pay-respects.enable = true; @@ -11,10 +13,12 @@ nushell.enable = true; }; + _module.args.pkgs = lib.mkForce realPkgs; + nmt.script = '' - assertFileNotRegex home-files/.bashrc '@pay-respects@/bin/pay-respects' - assertFileNotRegex home-files/.zshrc '@pay-respects@/bin/pay-respects' - assertFileNotRegex home-files/.config/fish/config.fish '@pay-respects@/bin/pay-respects' - assertFileNotRegex home-files/.config/nushell/config.nu '@pay-respects@/bin/pay-respects' + assertFileNotRegex home-files/.bashrc '/nix/store/[^/]*-pay-respects-[^/]*/bin/pay-respects' + assertFileNotRegex home-files/.zshrc '/nix/store/[^/]*-pay-respects-[^/]*/bin/pay-respects' + assertFileNotRegex home-files/.config/fish/config.fish '/nix/store/[^/]*-pay-respects-[^/]*/bin/pay-respects' + assertFileNotRegex home-files/.config/nushell/config.nu 'source /nix/store/[^/]*-pay-respects-nushell-config' ''; } diff --git a/tests/modules/programs/pay-respects/integration-enabled.nix b/tests/modules/programs/pay-respects/integration-enabled.nix index c76463f2b..e703f3632 100644 --- a/tests/modules/programs/pay-respects/integration-enabled.nix +++ b/tests/modules/programs/pay-respects/integration-enabled.nix @@ -1,3 +1,5 @@ +{ lib, realPkgs, ... }: + { programs = { pay-respects.enable = true; @@ -7,25 +9,27 @@ nushell.enable = true; }; + _module.args.pkgs = lib.mkForce realPkgs; + nmt.script = '' assertFileExists home-files/.bashrc - assertFileContains \ + assertFileRegex \ home-files/.bashrc \ - 'eval "$(@pay-respects@/bin/pay-respects bash --alias)"' + 'eval "$(/nix/store/[^/]*-pay-respects-[^/]*/bin/pay-respects bash --alias)"' assertFileExists home-files/.zshrc - assertFileContains \ + assertFileRegex \ home-files/.zshrc \ - 'eval "$(@pay-respects@/bin/pay-respects zsh --alias)"' + 'eval "$(/nix/store/[^/]*-pay-respects-[^/]*/bin/pay-respects zsh --alias)"' assertFileExists home-files/.config/fish/config.fish - assertFileContains \ + assertFileRegex \ home-files/.config/fish/config.fish \ - '@pay-respects@/bin/pay-respects fish --alias | source' + '/nix/store/[^/]*-pay-respects-[^/]*/bin/pay-respects fish --alias | source' assertFileExists home-files/.config/nushell/config.nu - assertFileContains \ + assertFileRegex \ home-files/.config/nushell/config.nu \ - '@pay-respects@/bin/pay-respects nushell --alias []' + 'source /nix/store/[^/]*-pay-respects-nushell-config' ''; }