nixos/lxc-container: ensure /sbin/init is updated on nixos-rebuild boot

This commit is contained in:
Aaron Andersen 2023-05-10 11:04:07 -04:00
parent fe7b996d66
commit dd2c3b1310

View File

@ -161,6 +161,11 @@ in
extraCommands = "mkdir -p proc sys dev";
};
system.build.installBootLoader = pkgs.writeScript "install-lxd-sbin-init.sh" ''
#!${pkgs.runtimeShell}
ln -fs "$1/init" /sbin/init
'';
# Add the overrides from lxd distrobuilder
# https://github.com/lxc/distrobuilder/blob/05978d0d5a72718154f1525c7d043e090ba7c3e0/distrobuilder/main.go#L630
systemd.packages = [