feat: Add iso and lxc generation artifacts

This commit is contained in:
UGA Innovation Factory
2025-12-10 13:29:23 -05:00
committed by Hunter Halloran
parent 5f68f6011c
commit 6498e7fd52
9 changed files with 203 additions and 8 deletions

View File

@@ -0,0 +1,47 @@
{ config, lib, pkgs, inputs, hostName, hostPlatform, targetSystem, diskoScript, ... }:
{
environment.systemPackages = [
pkgs.git
pkgs.bashInteractive
pkgs.curl
targetSystem
];
# Enable networking
networking.hostName = "autoinstaller-${hostName}";
networking.networkmanager.enable = lib.mkForce false;
networking.wireless = {
enable = true;
networks = {
"IOT_sensors".psk = "aaaaaaaa";
};
};
nixpkgs.hostPlatform = hostPlatform;
systemd.services.auto-install = {
description = "Automatic NixOS install for ${hostName}";
after = [ "network-online.target" "systemd-udev-settle.service" ];
wants = [ "network-online.target" ];
wantedBy = [ "multi-user.target" ];
serviceConfig = {
Type = "oneshot";
StandardOutput = "journal+console";
StandardError = "journal+console";
Environment = "PATH=/run/current-system/sw/bin";
};
script = ''
echo "=== AUTO INSTALL START for ${hostName} ==="
echo ">>> Running disko script..."
${diskoScript}
echo ">>> Running nixos-install..."
nixos-install --no-root-passwd --system ${targetSystem}
echo ">>> Done. Rebooting."
systemctl reboot
'';
};
}