From b59dce7305da74f868c12cb9647e38de56acd807 Mon Sep 17 00:00:00 2001 From: Zhaofeng Li Date: Tue, 23 Aug 2022 01:48:15 -0600 Subject: [PATCH] kernel: Fix pure evaluation This fixes usage in pure evaluation mode (e.g., flakes). --- nix/m1-support/kernel/package.nix | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/nix/m1-support/kernel/package.nix b/nix/m1-support/kernel/package.nix index a717de1c..dbea5251 100644 --- a/nix/m1-support/kernel/package.nix +++ b/nix/m1-support/kernel/package.nix @@ -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