From db6bb1b7a6a1e4bbef39304ce37b2de932f5471c Mon Sep 17 00:00:00 2001 From: Gerg-L Date: Mon, 20 Feb 2023 21:07:18 -0500 Subject: [PATCH] testing making my own iso installer --- flake.nix | 16 +++++++++++++++- iso/default.nix | 28 ++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 iso/default.nix diff --git a/flake.nix b/flake.nix index 2688cf4..ab4ba7e 100644 --- a/flake.nix +++ b/flake.nix @@ -7,6 +7,11 @@ #utilites --maybe flake-parts soon? flake-utils.url = "github:numtide/flake-utils"; + nixos-generators = { + url = "github:nix-community/nixos-generators"; + inputs.nixpkgs.follows = "unstable"; + }; + #master branch of nix nix.url = "github:NixOS/nix"; @@ -33,9 +38,9 @@ outputs = { self, unstable, - stable, flake-utils, nvim-flake, + nixos-generators, ... } @ inputs: { @@ -111,6 +116,15 @@ }; default = nix; }; + packages = { + nixos-iso = nixos-generators.nixosGenerate { + inherit system; + format = "install-iso"; + modules = [ + (import ./iso inputs) + ]; + }; + }; } ); } diff --git a/iso/default.nix b/iso/default.nix new file mode 100644 index 0000000..ce5cbb9 --- /dev/null +++ b/iso/default.nix @@ -0,0 +1,28 @@ +_: { + lib, + modulesPath, + ... +}: { + imports = [ + "${toString modulesPath}/profiles/minimal.nix" + "${toString modulesPath}/installer/cd-dvd/installation-cd-base.nix" + ]; + + # Causes a lot of uncached builds for a negligible decrease in size. + environment.noXlibs = lib.mkOverride 500 false; + + documentation.man.enable = lib.mkOverride 500 true; + + # Although we don't really need HTML documentation in the minimal installer, + # not including it may cause annoying cache misses in the case of the NixOS manual. + documentation.doc.enable = lib.mkOverride 500 true; + + fonts.fontconfig.enable = lib.mkForce false; + + isoImage = { + edition = lib.mkForce "gerg-minimal"; + + isoName = lib.mkForce "NixOS.iso"; + }; + +}