Open arianvp opened 4 years ago
Something like this would work:
result=$(nix-build --store /sysroot --no-out-link @systemConfig@)
nixos-install --no-channel-copy --system $result --root /sysroot
Pointing to a flake would also be an interesting option :)
initrd should be able to get a NixOS config and
nixos-install
it to/sysroot
beforeswitch-root
'ing to stage-2.Initrd could use kernel parameter pointing to the configuration file; e.g.:
or a derivation:
or an output path (which must be substitutable by a cache, or already exist on
/sysroot/nix/store
):In the future; we might want to support Cloud metadata services through github.com/coreos/afterburn and allow
user-data
too.Mechanism wil be implemented through a
systemd-generator
that orders a unit doing the realisation at the correct time in boot process (just after/sysroot
is mounted).See
man bootup