Skip to content

Commit

Permalink
Merge pull request #879 from jtt9340/spaces-in-nixpath
Browse files Browse the repository at this point in the history
fix broken NIX_PATH if paths contain spaces
  • Loading branch information
Enzime authored Nov 17, 2024
2 parents 2bcef10 + 9077d81 commit 34588d5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion modules/system/checks.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ''
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 34588d5

Please sign in to comment.