Skip to content

Commit

Permalink
activate-user script: fix broken NIX_PATH if paths contain spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
jtt9340 committed Feb 21, 2024
1 parent 0e6857f commit 4ae9333
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 @@ -121,7 +124,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 4ae9333

Please sign in to comment.