From c10344a8d2cd313571b8f748b062ca60d07c1356 Mon Sep 17 00:00:00 2001 From: Ritiek Malhotra Date: Sat, 19 Oct 2024 16:37:15 +0530 Subject: [PATCH] Experiment with more minimal generators --- flake.nix | 12 ++++++++++++ generators/minimal.nix | 44 +++++++++++++++++++++++++++++++++++++++++- 2 files changed, 55 insertions(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index 9323c98..9231d46 100644 --- a/flake.nix +++ b/flake.nix @@ -249,5 +249,17 @@ modules = [ ./generators/minimal.nix ]; format = "install-iso"; }; + + minimal-qcow-efi = nixos-generators.nixosGenerate { + system = "x86_64-linux"; + modules = [ ./generators/minimal.nix ]; + format = "qcow-efi"; + }; + + minimal-raw-efi = nixos-generators.nixosGenerate { + system = "x86_64-linux"; + modules = [ ./generators/minimal.nix ]; + format = "raw-efi"; + }; }; } diff --git a/generators/minimal.nix b/generators/minimal.nix index c23f473..c6a51c4 100644 --- a/generators/minimal.nix +++ b/generators/minimal.nix @@ -12,10 +12,52 @@ # }; # Swap files don't work as expected as they seem to use tmpfs. + # # swapDevices = [{ # device = "/swap"; - # size = 4 * 1024; # 4GB + # size = 2 * 1024; # 2GB # }]; + # + # disko.devices.disk.minimal = { + # device = "nodev"; + # content = { + # type = "gpt"; + # partitions = { + # plain-swap = { + # size = "2G"; + # content = { + # type = "swap"; + # discardPolicy = "both"; + # resumeDevice = true; + # }; + # }; + # }; + # }; + # }; + # + # disko.devices.nodev = { + # "/swap" = { + # fsType = "ext4"; + # mountOptions = [ + # "size=2G" + # "mode=755" + # ]; + # }; + # }; + + # systemd.tmpfiles.rules = [ + # "f /var/log/timers/backup - ${variables.username} ${variables.username} - -" + # ]; + + # systemd.tmpfiles.settings."swap" = { + # "/var/lib/swap" = { + # f = { + # group = "root"; + # mode = "0755"; + # user = "root"; + # }; + # }; + # }; # Disable sudo as we've no non-root users. security.sudo.enable = false;