kexec-installer: no need to put restoreNetwork into systemPackages

This commit is contained in:
Jörg Thalheim 2022-11-25 10:08:39 +01:00
parent 91abdb7e6e
commit 3928958de5

View file

@ -1,5 +1,9 @@
{ config, lib, modulesPath, pkgs, ... }: { config, lib, modulesPath, pkgs, ... }:
{ let
restoreNetwork = pkgs.writers.writePython3Bin "restore-network" {
flakeIgnore = ["E501"];
} ./restore_routes.py;
in {
imports = [ imports = [
(modulesPath + "/installer/netboot/netboot-minimal.nix") (modulesPath + "/installer/netboot/netboot-minimal.nix")
]; ];
@ -92,7 +96,7 @@
]; ];
wantedBy = [ "multi-user.target" ]; wantedBy = [ "multi-user.target" ];
after = [ "network.target" ]; after = [ "network.target" ];
serviceConfig.ExecStart = "/run/current-system/sw/bin/restore_network /root/network/addrs.json /root/network/routes.json"; serviceConfig.ExecStart = "${restoreNetwork} /root/network/addrs.json /root/network/routes.json";
unitConfig.ConditionPathExists = [ unitConfig.ConditionPathExists = [
"/root/network/addrs.json" "/root/network/addrs.json"
@ -100,12 +104,6 @@
]; ];
}; };
environment.systemPackages = [
(pkgs.writers.writePython3Bin "restore_network" {
flakeIgnore = ["E501"];
} ./restore_routes.py)
];
# Restore ssh host and user keys if they are available. # Restore ssh host and user keys if they are available.
# This avoids warnings of unknown ssh keys. # This avoids warnings of unknown ssh keys.
boot.initrd.postMountCommands = '' boot.initrd.postMountCommands = ''