mirror of
https://github.com/nix-community/home-manager.git
synced 2026-01-12 01:50:44 +08:00
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:
committed by
Matthieu Coudron
parent
46c9af8a92
commit
af7f14ddf7
@@ -7,4 +7,5 @@
|
||||
fish-plugins = ./plugins.nix;
|
||||
fish-manpage = ./manpage.nix;
|
||||
fish-binds = ./binds.nix;
|
||||
fish-session-variables = ./session-variables.nix;
|
||||
}
|
||||
|
||||
20
tests/modules/programs/fish/session-variables.nix
Normal file
20
tests/modules/programs/fish/session-variables.nix
Normal 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'"
|
||||
'';
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user