fish: expose session variables package

This allows fish users to source the `hm-session-vars.fish` if they are
not using the generated `config.fish` (which now sources the same file).
This commit is contained in:
Ian Chamberlain
2024-08-11 12:02:42 -04:00
committed by Matthieu Coudron
parent 46c9af8a92
commit af7f14ddf7
4 changed files with 46 additions and 6 deletions

View File

@@ -7,4 +7,5 @@
fish-plugins = ./plugins.nix;
fish-manpage = ./manpage.nix;
fish-binds = ./binds.nix;
fish-session-variables = ./session-variables.nix;
}

View File

@@ -0,0 +1,20 @@
{ config, ... }:
{
config = {
home.sessionVariables = {
V1 = "v1";
V2 = "v2-${config.home.sessionVariables.V1}";
};
programs.fish.enable = true;
nmt.script = ''
assertFileExists home-path/etc/profile.d/hm-session-vars.fish
assertFileRegex home-path/etc/profile.d/hm-session-vars.fish \
"set -gx V1 'v1'"
assertFileRegex home-path/etc/profile.d/hm-session-vars.fish \
"set -gx V1 'v1'"
'';
};
}