Skip to content

Commit

Permalink
kernel: Fix pure evaluation
Browse files Browse the repository at this point in the history
This fixes usage in pure evaluation mode (e.g., flakes).
  • Loading branch information
zhaofengli committed Aug 23, 2022
1 parent 626844b commit b59dce7
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions nix/m1-support/kernel/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@
}
else pkgs;

# we do this so the config can be read on any system and not affect
# the output hash
localPkgs = import (pkgs.path) { system = builtins.currentSystem; };
localPkgs =
# we do this so the config can be read on any system and not affect
# the output hash
if builtins ? currentSystem then import (pkgs.path) { system = builtins.currentSystem; }
else pkgs;

readConfig = configfile: import (localPkgs.runCommand "config.nix" {} ''
echo "{" > "$out"
while IFS='=' read key val; do
Expand Down

0 comments on commit b59dce7

Please sign in to comment.