From bd25df72fed1831f8db7521201e3b5c278fa9a68 Mon Sep 17 00:00:00 2001 From: Ari Sosnovsky Date: Mon, 16 Mar 2026 19:06:41 -0400 Subject: [PATCH] iso builder --- flake.nix | 11 +++++++++++ hosts/iso.nix | 47 +++++++++++++++++++++++++++++++++++++++++++++++ modules/lib.nix | 27 +++++++++++++++++++++++++++ 3 files changed, 85 insertions(+) create mode 100644 hosts/iso.nix diff --git a/flake.nix b/flake.nix index 76286a0..5d91ac6 100644 --- a/flake.nix +++ b/flake.nix @@ -184,5 +184,16 @@ ]; }; }; + + # Live ISO Configuration + # ------------- + packages.x86_64-linux = { + installer-iso = lib.makeIso { + hostName = "skygnix"; + configuration = [ + ./hosts/iso.nix + ]; + }; + }; }; } diff --git a/hosts/iso.nix b/hosts/iso.nix new file mode 100644 index 0000000..fbe5e3a --- /dev/null +++ b/hosts/iso.nix @@ -0,0 +1,47 @@ +{ config, lib, pkgs, ... }: +{ + # Root access without password + users.users.root.initialHashedPassword = ""; + security.sudo.wheelNeedsPassword = false; + + # Networking + networking.networkmanager.enable = true; + + # SSH for remote installation + services.openssh.enable = true; + services.openssh.settings.PermitRootLogin = "yes"; + + # GUI with lightweight desktop + services.xserver.enable = true; + services.xserver.displayManager.lightdm.enable = true; + services.xserver.desktopManager.xfce.enable = true; + + # Core system packages + environment.systemPackages = with pkgs; [ + # Disk tools + parted + gparted # GUI partitioner + cryptsetup + btrfs-progs + dosfstools + ntfs3g + e2fsprogs + + # Utilities + curl + wget + git + htop + tmux + + # Documentation + man-pages + ]; + + # Disable heavy services + services.printing.enable = lib.mkForce false; + sound.enable = lib.mkForce false; + + # Include documentation + documentation.nixos.enable = true; +} diff --git a/modules/lib.nix b/modules/lib.nix index 442137e..e1a91d9 100644 --- a/modules/lib.nix +++ b/modules/lib.nix @@ -74,6 +74,33 @@ in }) ] ++ configuration; }; + makeIso = + { system ? "x86_64-linux" + , hostName + , systemStateVersion ? "25.11" + , homeManagerVersion ? "25.11" + , configuration ? [ ] + }: nixpkgs.lib.nixosSystem { + specialArgs = specialArgs // { + inherit system skygUtils user; + unstablePkgs = nixpkgs-unstable.legacyPackages.${system}; + }; + inherit system; + modules = [ + "${nixpkgs}/nixos/modules/installer/cd-dvd/installation-cd-minimal.nix" + determinate.nixosModules.default + stylix.nixosModules.stylix + nix-flatpak.nixosModules.nix-flatpak + (import ./main.nix { + inherit + user + hostName + systemStateVersion + homeManagerVersion + ; + }) + ] ++ configuration; + }; makeDarwinModule = { system ? "x86_64-darwin" , user