From 74551af08ab767315dc66af02bee6662792e0d82 Mon Sep 17 00:00:00 2001 From: UGA Innovation Factory Date: Wed, 10 Dec 2025 13:38:50 -0500 Subject: [PATCH] update readme for how to build artifacts --- README.md | 34 ++++++++++++++++++++++++++++++++++ flake.nix | 19 ++++++++++++++----- 2 files changed, 48 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 59be60b..e3e31f7 100644 --- a/README.md +++ b/README.md @@ -50,6 +50,40 @@ To update the lockfile (nixpkgs, home-manager versions, etc.): nix flake update ``` +## Building Artifacts (ISOs, LXC, Proxmox) + +You can generate installation media and virtual machine images directly from this flake. + +### Installer ISOs + +To build an auto-install ISO for a specific host (e.g., `nix-laptop1`): + +```bash +nix build .#installer-iso-nix-laptop1 +``` + +The resulting ISO will be in `result/iso/`. + +### LXC / Proxmox Images + +For hosts configured as containers (e.g., `nix-lxc1`), you can build LXC tarballs or Proxmox VMA archives: + +```bash +# Build LXC tarball +nix build .#lxc-nix-lxc1 + +# Build Proxmox VMA +nix build .#proxmox-nix-lxc1 +``` + +### Using Remote Builders + +If you are building on a low-power device (like a Surface tablet) or want to speed up the build, you can offload the build to a powerful remote builder (e.g., `nix-builder`): + +```bash +nix build .#installer-iso-nix-laptop1 --builders 'ssh:engr-ugaif@nix-builder' +``` + ## Configuration Guide ### Adding a New User diff --git a/flake.nix b/flake.nix index 7239249..628e57d 100644 --- a/flake.nix +++ b/flake.nix @@ -58,17 +58,26 @@ }: let hosts = import ./hosts { inherit inputs; }; - system = "x86_64-linux"; + linuxSystem = "x86_64-linux"; + artifacts = import ./artifacts.nix { + inherit inputs hosts self; + system = linuxSystem; + }; + forAllSystems = nixpkgs.lib.genAttrs [ + "x86_64-linux" + "aarch64-linux" + "x86_64-darwin" + "aarch64-darwin" + ]; in { # Formatter for 'nix fmt' - formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.nixfmt-rfc-style; + formatter = forAllSystems (system: nixpkgs.legacyPackages.${system}.nixfmt-rfc-style); # Generate NixOS configurations from hosts/default.nix nixosConfigurations = hosts.nixosConfigurations; - packages.${system} = import ./artifacts.nix { - inherit inputs hosts self system; - }; + # Expose artifacts to all systems, but they are always built for x86_64-linux + packages = forAllSystems (_: artifacts); }; }