From 807d15f1ec0eb280845795761e4136a37aa0db06 Mon Sep 17 00:00:00 2001 From: Git Sagar Date: Fri, 13 Mar 2026 20:42:05 -0300 Subject: [PATCH] Convert to flake, remove old channel-based build files Replace nix-build scripts and standalone ISO configs with a flake.nix pinned to nixos-25.11. Build with `nix build .#minimal-iso` or `nix build .#graphical-iso`. Co-Authored-By: Claude Opus 4.6 --- flake.nix | 38 ++++++++++++++++++++++++++++++++++++++ graphical-iso.nix | 13 ------------- minimal-iso.nix | 13 ------------- scripts/build-graphical.sh | 1 - scripts/build-minimal.sh | 1 - 5 files changed, 38 insertions(+), 28 deletions(-) create mode 100644 flake.nix delete mode 100644 graphical-iso.nix delete mode 100644 minimal-iso.nix delete mode 100644 scripts/build-graphical.sh delete mode 100644 scripts/build-minimal.sh diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..dc6aa13 --- /dev/null +++ b/flake.nix @@ -0,0 +1,38 @@ +{ + description = "Custom NixOS ISO images"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.11"; + }; + + outputs = { self, nixpkgs }: let + system = "x86_64-linux"; + in { + nixosConfigurations = { + graphical-iso = nixpkgs.lib.nixosSystem { + inherit system; + modules = [ + "${nixpkgs}/nixos/modules/installer/cd-dvd/installation-cd-graphical-calamares-gnome.nix" + "${nixpkgs}/nixos/modules/installer/cd-dvd/channel.nix" + ./common.nix + ]; + }; + + minimal-iso = nixpkgs.lib.nixosSystem { + inherit system; + modules = [ + "${nixpkgs}/nixos/modules/installer/cd-dvd/installation-cd-minimal.nix" + "${nixpkgs}/nixos/modules/installer/cd-dvd/channel.nix" + ./common.nix + { isoImage.forceTextMode = true; } + ]; + }; + }; + + packages.${system} = { + graphical-iso = self.nixosConfigurations.graphical-iso.config.system.build.isoImage; + minimal-iso = self.nixosConfigurations.minimal-iso.config.system.build.isoImage; + default = self.packages.${system}.minimal-iso; + }; + }; +} diff --git a/graphical-iso.nix b/graphical-iso.nix deleted file mode 100644 index 660caa4..0000000 --- a/graphical-iso.nix +++ /dev/null @@ -1,13 +0,0 @@ -# from https://nixos.wiki/wiki/Creating_a_NixOS_live_CD -{ config, pkgs, ... }: -{ - imports = [ - - - # Provide an initial copy of the NixOS channel so that the user - # doesn't need to run "nix-channel --update" first. - - ./common.nix - ]; - -} diff --git a/minimal-iso.nix b/minimal-iso.nix deleted file mode 100644 index a1c9686..0000000 --- a/minimal-iso.nix +++ /dev/null @@ -1,13 +0,0 @@ -#from https://nixos.wiki/wiki/Creating_a_NixOS_live_CD -{ config, pkgs, ... }: -{ - imports = [ - - - # Provide an initial copy of the NixOS channel so that the user - # doesn't need to run "nix-channel --update" first. - - ./common.nix - ]; - -} diff --git a/scripts/build-graphical.sh b/scripts/build-graphical.sh deleted file mode 100644 index d012525..0000000 --- a/scripts/build-graphical.sh +++ /dev/null @@ -1 +0,0 @@ -nix-build '' -A config.system.build.isoImage -I nixos-config=graphical-iso.nix diff --git a/scripts/build-minimal.sh b/scripts/build-minimal.sh deleted file mode 100644 index ec91c7a..0000000 --- a/scripts/build-minimal.sh +++ /dev/null @@ -1 +0,0 @@ -nix-build '' -A config.system.build.isoImage -I nixos-config=minimal-iso.nix