Merge branch 'offline-installer'

This commit was merged in pull request #24.
This commit is contained in:
UGA Innovation Factory
2026-01-05 15:49:19 -05:00
3 changed files with 27 additions and 23 deletions

24
flake.lock generated
View File

@@ -318,11 +318,11 @@
]
},
"locked": {
"lastModified": 1767024057,
"narHash": "sha256-B1aycRjMRvb6QOGbnqDhiDzZwMebj5jxZ5qyJzaKvpI=",
"lastModified": 1767619900,
"narHash": "sha256-KpoCBPvwHz3gAQtIUkohE2InRBFK3r0/FM6z5SPWfvM=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "34578a2fdfce4257ce5f5baf6e7efbd4e4e252b1",
"rev": "6bd04da47cfb48dfd15eabf08364b78ad894f5b2",
"type": "github"
},
"original": {
@@ -464,11 +464,11 @@
},
"nixos-hardware": {
"locked": {
"lastModified": 1766568855,
"narHash": "sha256-UXVtN77D7pzKmzOotFTStgZBqpOcf8cO95FcupWp4Zo=",
"lastModified": 1767185284,
"narHash": "sha256-ljDBUDpD1Cg5n3mJI81Hz5qeZAwCGxon4kQW3Ho3+6Q=",
"owner": "NixOS",
"repo": "nixos-hardware",
"rev": "c5db9569ac9cc70929c268ac461f4003e3e5ca80",
"rev": "40b1a28dce561bea34858287fbb23052c3ee63fe",
"type": "github"
},
"original": {
@@ -518,11 +518,11 @@
},
"nixpkgs-old-kernel": {
"locked": {
"lastModified": 1766687554,
"narHash": "sha256-DegN7KD/EtFSKXf2jvqL6lvev6GlfAAatYBcRC8goEo=",
"lastModified": 1767051569,
"narHash": "sha256-0MnuWoN+n1UYaGBIpqpPs9I9ZHW4kynits4mrnh1Pk4=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "fd0ca39c92fdb4012ed8d60e1683c26fddadd136",
"rev": "40ee5e1944bebdd128f9fbada44faefddfde29bd",
"type": "github"
},
"original": {
@@ -534,11 +534,11 @@
},
"nixpkgs_2": {
"locked": {
"lastModified": 1766885793,
"narHash": "sha256-P6RVkrM9JLCW6xBjSwHfgTOQ1JwBUma5xe5LI8xAPC0=",
"lastModified": 1767480499,
"narHash": "sha256-8IQQUorUGiSmFaPnLSo2+T+rjHtiNWc+OAzeHck7N48=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "9ef261221d1e72399f2036786498d78c38185c46",
"rev": "30a3c519afcf3f99e2c6df3b359aec5692054d92",
"type": "github"
},
"original": {

View File

@@ -18,7 +18,7 @@ let
hostName:
let
targetConfig = self.nixosConfigurations.${hostName}.config;
targetSystem = targetConfig.system.build.toplevel;
targetSystemBuild = targetConfig.system.build;
diskoScript = targetConfig.system.build.diskoScript;
in
nixpkgs.lib.nixosSystem {
@@ -27,7 +27,7 @@ let
inherit
inputs
hostName
targetSystem
targetSystemBuild
diskoScript
;
hostPlatform = system;

View File

@@ -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