summary refs log tree commit diff
path: root/nixos/modules/system/activation/top-level.nix
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2021-09-13 10:45:17 +0000
committerAlyssa Ross <hi@alyssa.is>2021-09-13 11:13:38 +0000
commit0f279e2e0c1ba0ad5bfbd79f055b9a2a9773f080 (patch)
tree2e8e1a3f12df2a037a417594e5eb1c682dabac35 /nixos/modules/system/activation/top-level.nix
parentd1139de938d16fd52dbddf1a3a112d9a08e2d4dd (diff)
downloadnixpkgs-0f279e2e0c1ba0ad5bfbd79f055b9a2a9773f080.tar
nixpkgs-0f279e2e0c1ba0ad5bfbd79f055b9a2a9773f080.tar.gz
nixpkgs-0f279e2e0c1ba0ad5bfbd79f055b9a2a9773f080.tar.bz2
nixpkgs-0f279e2e0c1ba0ad5bfbd79f055b9a2a9773f080.tar.lz
nixpkgs-0f279e2e0c1ba0ad5bfbd79f055b9a2a9773f080.tar.xz
nixpkgs-0f279e2e0c1ba0ad5bfbd79f055b9a2a9773f080.tar.zst
nixpkgs-0f279e2e0c1ba0ad5bfbd79f055b9a2a9773f080.zip
nixos/top-level: fix cross
When cross-compiling, we can't run the runtime shell to check syntax
if it's e.g. for a different architecture.  We have two options here.
We can disable syntax checking when cross compiling, but that risks
letting errors through.  Or, we can do what I've done here, and change
the syntax check to use stdenv's shell instead of the runtime shell.
This requires the stdenv shell and runtime shell to be broadly
compatible, but I think that's so ingrained in Nixpkgs anyway that
it's fine.  And this way we avoid conditionals that check for cross.
Diffstat (limited to 'nixos/modules/system/activation/top-level.nix')
-rw-r--r--nixos/modules/system/activation/top-level.nix4
1 files changed, 2 insertions, 2 deletions
diff --git a/nixos/modules/system/activation/top-level.nix b/nixos/modules/system/activation/top-level.nix
index 616e1422aa8..dad9acba91a 100644
--- a/nixos/modules/system/activation/top-level.nix
+++ b/nixos/modules/system/activation/top-level.nix
@@ -61,8 +61,8 @@ let
       substituteInPlace $out/dry-activate --subst-var out
       chmod u+x $out/activate $out/dry-activate
       unset activationScript dryActivationScript
-      ${pkgs.runtimeShell} -n $out/activate
-      ${pkgs.runtimeShell} -n $out/dry-activate
+      ${pkgs.stdenv.shell} -n $out/activate
+      ${pkgs.stdenv.shell} -n $out/dry-activate
 
       cp ${config.system.build.bootStage2} $out/init
       substituteInPlace $out/init --subst-var-by systemConfig $out