1
0
Fork 0
mirror of https://github.com/LnL7/nix-darwin.git synced 2024-12-14 11:57:34 +00:00

Merge pull request #879 from jtt9340/spaces-in-nixpath

fix broken NIX_PATH if paths contain spaces
This commit is contained in:
Michael Hoang 2024-11-17 02:04:32 +00:00 committed by GitHub
commit 34588d57cf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -3,6 +3,9 @@
with lib; with lib;
let 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; cfg = config.system.checks;
darwinChanges = '' darwinChanges = ''
@ -188,7 +191,7 @@ let
''; '';
nixPath = '' 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 darwinConfig=$(NIX_PATH=$nixPath nix-instantiate --find-file darwin-config) || true
if ! test -e "$darwinConfig"; then if ! test -e "$darwinConfig"; then