mirror of
https://github.com/nix-community/home-manager
synced 2024-11-16 08:09:45 +01:00
7d4f510f26
This commit introduces `home.sessionSearchVariables` option, that is created to be a "generic" version of `home.sessionPath` for any environment variables that is similar to PATH (e.g.: MANPATH). This allows composition of those variables between multiple modules, avoiding issues like this one: https://github.com/nix-community/home-manager/pull/4579/files#r1364374048 This commit also reimplements `home.sessionPath` as terms of `home.sessionSearchVariables`, to reduce code duplication and show that the code is correct.
15 lines
406 B
Nix
15 lines
406 B
Nix
{ config, lib, pkgs, ... }:
|
|
|
|
{
|
|
imports = [
|
|
({ ... }: { config.home.sessionSearchVariables.TEST = [ "foo" ]; })
|
|
({ ... }: { config.home.sessionSearchVariables.TEST = [ "bar" "baz" ]; })
|
|
];
|
|
|
|
nmt.script = ''
|
|
hmSessVars=home-path/etc/profile.d/hm-session-vars.sh
|
|
assertFileExists $hmSessVars
|
|
assertFileContains $hmSessVars \
|
|
'export TEST="$TEST''${TEST:+:}bar:baz:foo"'
|
|
'';
|
|
}
|