summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorJoey Territo <joeyterrito@hotmail.com>2024-02-21 16:13:30 -0600
committerJoseph Territo <josephterrito@Joeys-MacBook-Pro-2.local>2024-11-13 22:24:48 -0600
commit9077d812d8d6ed57b7c805467bb1bab78575e75a (patch)
tree524be0339df1f45246a3d0e2f57ff93711e213c8 /modules
parent6c71c49e2448e51ad830ed211024e6d0edc50116 (diff)
activate-user script: fix broken NIX_PATH if paths contain spaces
Diffstat (limited to 'modules')
-rw-r--r--modules/system/checks.nix5
1 files changed, 4 insertions, 1 deletions
diff --git a/modules/system/checks.nix b/modules/system/checks.nix
index ab6ea19..ef5f6d6 100644
--- a/modules/system/checks.nix
+++ b/modules/system/checks.nix
@@ -3,6 +3,9 @@
with lib;
let
+ # Similar to lib.escapeShellArg but escapes "s instead of 's, to allow for parameter expansion in shells
+ escapeDoubleQuote = arg: ''"${replaceStrings ["\""] ["\"\\\"\""] (toString arg)}"'';
+
cfg = config.system.checks;
darwinChanges = ''
@@ -180,7 +183,7 @@ let
'';
nixPath = ''
- nixPath=${concatStringsSep ":" config.nix.nixPath}:$HOME/.nix-defexpr/channels
+ nixPath=${concatMapStringsSep ":" escapeDoubleQuote config.nix.nixPath}:$HOME/.nix-defexpr/channels
darwinConfig=$(NIX_PATH=$nixPath nix-instantiate --find-file darwin-config) || true
if ! test -e "$darwinConfig"; then