about summary refs log tree commit diff
path: root/configurations/default.nix
diff options
context:
space:
mode:
authorAzat Bahawi <azat@bahawi.net>2024-05-01 03:36:55 +0300
committerAzat Bahawi <azat@bahawi.net>2024-05-01 03:36:55 +0300
commit9a20404924fda2587ce4f9769f75369799f34643 (patch)
treea953941a22d6c031e67b267e35a11db72bdd25e3 /configurations/default.nix
parent2024-04-29 (diff)
2024-05-01
Diffstat (limited to '')
-rw-r--r--configurations/default.nix96
1 files changed, 96 insertions, 0 deletions
diff --git a/configurations/default.nix b/configurations/default.nix
new file mode 100644
index 0000000..1c1bda0
--- /dev/null
+++ b/configurations/default.nix
@@ -0,0 +1,96 @@
+inputs:
+with inputs.self.lib;
+let
+  mkConfiguration =
+    name:
+    {
+      modules ? [ ],
+      configuration ? ./${name},
+      this ? my.configurations.${name},
+    }:
+    nameValuePair name (nixosSystem {
+      inherit (this) system;
+      modules =
+        modules
+        ++ attrValues inputs.self.nixosModules
+        ++ attrValues inputs.nix-topology.nixosModules
+        ++ optional (configuration != null) (import configuration);
+      specialArgs = {
+        inherit inputs this;
+        inherit (inputs.self) lib;
+      };
+    });
+in
+mapAttrs' mkConfiguration (
+  let
+    mkTest = this: {
+      modules = with inputs; [
+        "${nixpkgs}/nixos/modules/profiles/qemu-guest.nix"
+        nixpkgs.nixosModules.notDetected
+      ];
+      inherit this;
+    };
+  in
+  {
+    test-headless = mkTest {
+      hostname = "test-headless";
+      system = "x86_64-linux";
+      isHeadless = true;
+      isHeadful = false;
+    };
+
+    test-headful = mkTest {
+      hostname = "test-headful";
+      system = "x86_64-linux";
+      isHeadless = false;
+      isHeadful = true;
+    };
+
+    iso = {
+      this = {
+        hostname = "iso";
+        system = "x86_64-linux";
+        isHeadless = false;
+        isHeadful = false;
+      };
+      modules = [
+        "${inputs.nixpkgs}/nixos/modules/installer/cd-dvd/installation-cd-minimal-new-kernel.nix"
+      ];
+    };
+
+    eonwe.modules = with inputs; [
+      nixos-hardware.nixosModules.common-cpu-amd
+      nixos-hardware.nixosModules.common-cpu-amd-pstate
+      nixos-hardware.nixosModules.common-gpu-amd
+      nixos-hardware.nixosModules.common-pc-ssd
+      nixpkgs.nixosModules.notDetected
+    ];
+
+    melian.modules = with inputs; [
+      nixos-hardware.nixosModules.common-pc-laptop-ssd
+      nixos-hardware.nixosModules.lenovo-thinkpad-t480
+      nixpkgs.nixosModules.notDetected
+    ];
+
+    manwe.modules = with inputs; [
+      "${nixpkgs}/nixos/modules/profiles/qemu-guest.nix"
+      nixos-hardware.nixosModules.common-cpu-amd
+      nixos-hardware.nixosModules.common-pc-ssd
+      nixpkgs.nixosModules.notDetected
+    ];
+
+    varda.modules = with inputs; [
+      "${nixpkgs}/nixos/modules/profiles/qemu-guest.nix"
+      nixos-hardware.nixosModules.common-cpu-amd
+      nixos-hardware.nixosModules.common-pc-ssd
+      nixpkgs.nixosModules.notDetected
+    ];
+
+    yavanna.modules = with inputs; [
+      "${nixpkgs}/nixos/modules/profiles/qemu-guest.nix"
+      nixos-hardware.nixosModules.common-cpu-intel
+      nixos-hardware.nixosModules.common-pc-hdd
+      nixpkgs.nixosModules.notDetected
+    ];
+  }
+)

Consider giving Nix/NixOS a try! <3