Merge branch 'offline-installer'
This commit was merged in pull request #24.
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
inputs,
|
||||
hostName,
|
||||
hostPlatform,
|
||||
targetSystem,
|
||||
targetSystemBuild,
|
||||
diskoScript,
|
||||
...
|
||||
}:
|
||||
@@ -18,7 +18,7 @@
|
||||
pkgs.git
|
||||
pkgs.bashInteractive
|
||||
pkgs.curl
|
||||
targetSystem
|
||||
targetSystemBuild.toplevel
|
||||
];
|
||||
|
||||
# Explicitly include the system closure in the ISO image to prevent any need to build or fetch
|
||||
@@ -31,6 +31,12 @@
|
||||
|
||||
nixpkgs.hostPlatform = hostPlatform;
|
||||
|
||||
nix.settings.experimental-features = "nix-command flakes";
|
||||
|
||||
system.extraDependencies = with targetSystemBuild; [ toplevel etc bootStage2 ];
|
||||
|
||||
isoImage.storeContents = [ targetSystemBuild.toplevel ];
|
||||
|
||||
systemd.services.auto-install = {
|
||||
description = "Automatic NixOS install for ${hostName}";
|
||||
after = [
|
||||
@@ -53,14 +59,12 @@
|
||||
echo ">>> Running disko script..."
|
||||
${diskoScript}
|
||||
|
||||
echo ">>> Running nixos-install..."
|
||||
# Use only local store - don't fetch from binary cache or build
|
||||
echo ">>> Setting up NixOS..."
|
||||
nixos-install \
|
||||
--no-root-passwd \
|
||||
--root /mnt \
|
||||
--system ${targetSystem} \
|
||||
--option substitute false \
|
||||
--option build-use-sandbox false
|
||||
--system ${targetSystemBuild.toplevel} \
|
||||
--no-root-passwd \
|
||||
--no-channel-copy \
|
||||
--substituters ""
|
||||
|
||||
echo ">>> Done. Rebooting."
|
||||
systemctl reboot
|
||||
|
||||
Reference in New Issue
Block a user