1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-11-08 19:46:05 +01:00

home-environment: add line-break after sessionSearchVariables (#6596)

PR #6593 broke activation when `sessionVariablesExtra` is used, e.g.:
`services.ssh-agent` because it concatenate the strings without a line
break, so the resulting `hm-session-vars.sh` file became:

```bash
export XCURSOR_PATH="/etc/profiles/per-user/thiagoko/share/icons${XCURSOR_PATH:+:}$XCURSOR_PATH"if [ -z "$SSH_AUTH_SOCK" ]; then
  export SSH_AUTH_SOCK=$XDG_RUNTIME_DIR/ssh-agent
fi
```

This commit fixes it by enforcing a line break between
`sessionSearchVariables` and `sessionVariablesExtra`.
This commit is contained in:
Thiago Kenji Okada 2025-03-09 17:57:44 +00:00 committed by GitHub
parent 2967de4d11
commit db4386d686
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 2 deletions

View file

@ -601,7 +601,7 @@ in
(env: values: config.lib.shell.export
env
(config.lib.shell.prependToVar ":" env values))
cfg.sessionSearchVariables)
cfg.sessionSearchVariables) + "\n"
+ cfg.sessionVariablesExtra;
};

View file

@ -1,4 +1,4 @@
{ config, lib, pkgs, ... }:
{ config, pkgs, ... }:
let
@ -16,6 +16,7 @@ let
export XDG_CONFIG_HOME="/home/hm-user/.config"
export XDG_DATA_HOME="/home/hm-user/.local/share"
export XDG_STATE_HOME="/home/hm-user/.local/state"
'';
darwinExpected = ''
@ -29,6 +30,7 @@ let
export XDG_CONFIG_HOME="/home/hm-user/.config"
export XDG_DATA_HOME="/home/hm-user/.local/share"
export XDG_STATE_HOME="/home/hm-user/.local/state"
'';
expected = pkgs.writeText "expected"