Skip to content

Commit

Permalink
nixos: Move top-level stage2 def to stage-2.nix
Browse files Browse the repository at this point in the history
  • Loading branch information
roberth committed Dec 9, 2021
1 parent 2bf147c commit c78d41a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
5 changes: 0 additions & 5 deletions nixos/modules/system/activation/top-level.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,10 @@ let
''
mkdir $out
cp ${config.system.build.bootStage2} $out/init
substituteInPlace $out/init --subst-var-by systemConfig $out
ln -s ${config.system.build.etc}/etc $out/etc
ln -s ${config.system.path} $out/sw
ln -s "$systemd" $out/systemd
echo -n "$configurationName" > $out/configuration-name
echo -n "systemd ${toString config.systemd.package.interfaceVersion}" > $out/init-interface-version
echo -n "$nixosLabel" > $out/nixos-version
echo -n "${toString config.system.extraDependencies}" > $out/extra-dependencies
Expand Down
7 changes: 7 additions & 0 deletions nixos/modules/system/boot/stage-2.nix
Original file line number Diff line number Diff line change
Expand Up @@ -104,5 +104,12 @@ in

system.build.bootStage2 = bootStage2;

system.systemBuilderCommands = ''
cp ${config.system.build.bootStage2} $out/init
substituteInPlace $out/init --subst-var-by systemConfig $out
ln -s "$systemd" $out/systemd
echo -n "systemd ${toString config.systemd.package.interfaceVersion}" > $out/init-interface-version
'';

};
}

0 comments on commit c78d41a

Please sign in to comment.