mirror of
https://github.com/nix-community/home-manager.git
synced 2026-01-11 17:39:37 +08:00
lib/zsh: revert escapeShellArg in toZshValue
Causes variables to be generated with single ticks breaking shell expansion. Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
This commit is contained in:
@@ -36,6 +36,6 @@
|
||||
assertFileContains home-files/.zshenv \
|
||||
'. "/home/hm-user/.nix-profile/etc/profile.d/hm-session-vars.sh"'
|
||||
assertFileContains home-files/.zshenv \
|
||||
'export FOO=bar'
|
||||
'export FOO="bar"'
|
||||
'';
|
||||
}
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
{ config, ... }:
|
||||
{ config, lib, ... }:
|
||||
|
||||
{
|
||||
programs.zsh = {
|
||||
enable = true;
|
||||
|
||||
sessionVariables = {
|
||||
PATH = "$HOME/bin:$PATH";
|
||||
V1 = "v1";
|
||||
V2 = "v2-${config.programs.zsh.sessionVariables.V1}";
|
||||
};
|
||||
@@ -12,7 +13,6 @@
|
||||
|
||||
nmt.script = ''
|
||||
assertFileExists home-files/.zshenv
|
||||
assertFileRegex home-files/.zshenv 'export V1=v1'
|
||||
assertFileRegex home-files/.zshenv 'export V2=v2-v1'
|
||||
assertFileContent home-files/.zshenv ${./session-variables.zshenv}
|
||||
'';
|
||||
}
|
||||
|
||||
10
tests/modules/programs/zsh/session-variables.zshenv
Normal file
10
tests/modules/programs/zsh/session-variables.zshenv
Normal file
@@ -0,0 +1,10 @@
|
||||
# Environment variables
|
||||
. "/home/hm-user/.nix-profile/etc/profile.d/hm-session-vars.sh"
|
||||
|
||||
# Only source this once
|
||||
if [[ -z "$__HM_ZSH_SESS_VARS_SOURCED" ]]; then
|
||||
export __HM_ZSH_SESS_VARS_SOURCED=1
|
||||
export PATH="$HOME/bin:$PATH"
|
||||
export V1="v1"
|
||||
export V2="v2-v1"
|
||||
fi
|
||||
Reference in New Issue
Block a user