summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorMichael Hoang <Enzime@users.noreply.github.com>2024-11-17 02:04:32 +0000
committerGitHub <noreply@github.com>2024-11-17 02:04:32 +0000
commit34588d57cfc41c6953c54c93b6b685cab3b548ee (patch)
treec151616f7a439cc1da643b9b1b0e6e4851383b19 /modules
parent2bcef10f4319f34ddebadb5f37eaa81ca2510730 (diff)
parent9077d812d8d6ed57b7c805467bb1bab78575e75a (diff)
Merge pull request #879 from jtt9340/spaces-in-nixpath
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 949a28e..f3f1e6d 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 = ''
@@ -188,7 +191,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