From b47437ff1787a9553a309a116ebf99e9c09ccd83 Mon Sep 17 00:00:00 2001 From: Git Sagar Date: Thu, 3 Aug 2023 20:55:48 +0000 Subject: [PATCH] custom nixos iso build confs --- .gitignore | 2 ++ common.nix | 7 +++++++ graphical-iso.nix | 12 ++++++++++++ minimal-iso.nix | 12 ++++++++++++ scripts/build-graphical.sh | 1 + scripts/build-minimal.sh | 1 + 6 files changed, 35 insertions(+) create mode 100644 .gitignore create mode 100644 common.nix create mode 100644 graphical-iso.nix create mode 100644 minimal-iso.nix create mode 100644 scripts/build-graphical.sh create mode 100644 scripts/build-minimal.sh diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1b8d10d --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +*.iso +result diff --git a/common.nix b/common.nix new file mode 100644 index 0000000..81f1882 --- /dev/null +++ b/common.nix @@ -0,0 +1,7 @@ +{ config, pkgs, ... }: +{ + boot.supportedFilesystems = [ "ntfs" ]; + nix.settings.experimental-features = [ "nix-command" "flakes" ]; + isoImage.squashfsCompression = "gzip -Xcompression-level 1"; + environment.systemPackages = with pkgs; [ git htop btop usbutils pciutils file iotop iftop tmux micro (pass.withExtensions (ext: [ext.pass-otp])) ]; +} diff --git a/graphical-iso.nix b/graphical-iso.nix new file mode 100644 index 0000000..6269c97 --- /dev/null +++ b/graphical-iso.nix @@ -0,0 +1,12 @@ +{ 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 new file mode 100644 index 0000000..f04ff54 --- /dev/null +++ b/minimal-iso.nix @@ -0,0 +1,12 @@ +{ 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 new file mode 100644 index 0000000..d012525 --- /dev/null +++ b/scripts/build-graphical.sh @@ -0,0 +1 @@ +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 new file mode 100644 index 0000000..ec91c7a --- /dev/null +++ b/scripts/build-minimal.sh @@ -0,0 +1 @@ +nix-build '' -A config.system.build.isoImage -I nixos-config=minimal-iso.nix