summaryrefslogtreecommitdiff
path: root/configurations/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'configurations/default.nix')
-rw-r--r--configurations/default.nix190
1 files changed, 62 insertions, 128 deletions
diff --git a/configurations/default.nix b/configurations/default.nix
index e0741dc..124baec 100644
--- a/configurations/default.nix
+++ b/configurations/default.nix
@@ -2,138 +2,72 @@
inputs,
lib,
}:
-with lib; {
- # TODO Make a generic wrapper for all hosts.
- melian = let
- system = "x86_64-linux";
- in
- nixosSystem {
- inherit system;
-
- modules =
- attrValues inputs.self.nixosModules
- ++ [./melian]
- ++ (with inputs;
- (with nixos-hardware.nixosModules; [
- common-pc-laptop-ssd
- lenovo-thinkpad-t480
- ])
- ++ [nixpkgs.nixosModules.notDetected]);
-
- specialArgs = rec {
- inherit inputs lib;
- this = my.configurations.melian;
- };
- };
-
- manwe = let
- system = "x86_64-linux";
- in
- nixosSystem {
- inherit system;
-
- modules =
- attrValues inputs.self.nixosModules
- ++ [./manwe]
- ++ (with inputs;
- (with nixos-hardware.nixosModules; [common-cpu-amd common-pc-ssd])
- ++ [
- nixpkgs.nixosModules.notDetected
- "${nixpkgs}/nixos/modules/profiles/qemu-guest.nix"
- ]);
-
- specialArgs = rec {
- inherit inputs lib;
- this = my.configurations.manwe;
- };
- };
-
- varda = let
- system = "x86_64-linux";
- in
- nixosSystem {
- inherit system;
-
- modules =
- attrValues inputs.self.nixosModules
- ++ [./varda]
- ++ (with inputs;
- (with nixos-hardware.nixosModules; [common-cpu-amd common-pc-ssd])
- ++ [
- nixpkgs.nixosModules.notDetected
- "${nixpkgs}/nixos/modules/profiles/qemu-guest.nix"
- ]);
-
- specialArgs = rec {
- inherit inputs lib;
- this = my.configurations.varda;
- };
- };
-
- yavanna = let
- system = "x86_64-linux";
- in
- nixosSystem {
- inherit system;
-
+with lib; let
+ mkConfiguration = name: {
+ modules ? [],
+ configuration ? ./${name},
+ this ? my.configurations.${name},
+ }:
+ nameValuePair name (nixosSystem {
+ inherit (this) system;
modules =
attrValues inputs.self.nixosModules
- ++ [./yavanna]
- ++ (with inputs;
- (with nixos-hardware.nixosModules; [common-cpu-intel common-pc-hdd])
- ++ [nixpkgs.nixosModules.notDetected]);
-
- specialArgs = rec {
- inherit inputs lib;
- this = my.configurations.yavanna;
+ ++ modules
+ ++ [(import configuration)];
+ specialArgs = {inherit inputs lib this;};
+ });
+in
+ mapAttrs' mkConfiguration {
+ 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
+ ];
+
+ test-headless = {
+ modules = with inputs; [
+ "${nixpkgs}/nixos/modules/profiles/qemu-guest.nix"
+ nixpkgs.nixosModules.notDetected
+ ];
+ this = {
+ hostname = "test-headless";
+ system = "x86_64-linux";
+ isHeadless = true;
+ isHeadful = false;
};
};
- test-headless = let
- system = "x86_64-linux";
- in
- nixosSystem {
- inherit system;
-
- modules =
- attrValues inputs.self.nixosModules
- ++ [./test-headless]
- ++ (with inputs; [
- nixpkgs.nixosModules.notDetected
- "${nixpkgs}/nixos/modules/profiles/qemu-guest.nix"
- ]);
-
- specialArgs = rec {
- inherit inputs lib;
- this = {
- hostname = "test-headless";
- isHeadless = true;
- isHeadful = false;
- };
- };
- };
-
- test-headful = let
- system = "x86_64-linux";
- in
- nixosSystem {
- inherit system;
-
- modules =
- attrValues inputs.self.nixosModules
- ++ [./test-headful]
- ++ (with inputs; [
- nixpkgs.nixosModules.notDetected
- "${nixpkgs}/nixos/modules/profiles/qemu-guest.nix"
- ]);
-
- specialArgs = rec {
- inherit inputs lib;
- this = {
- hostname = "test-headful";
- isHeadful = true;
- isHeadless = false;
- };
+ test-headful = {
+ modules = with inputs; [
+ "${nixpkgs}/nixos/modules/profiles/qemu-guest.nix"
+ nixpkgs.nixosModules.notDetected
+ ];
+ this = {
+ hostname = "test-headful";
+ system = "x86_64-linux";
+ isHeadless = false;
+ isHeadful = true;
};
};
-}
+ }