about summary refs log tree commit diff
path: root/flake.nix
diff options
context:
space:
mode:
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix66
1 files changed, 36 insertions, 30 deletions
diff --git a/flake.nix b/flake.nix
index 0db2666..3618e4a 100644
--- a/flake.nix
+++ b/flake.nix
@@ -11,37 +11,43 @@
 		nixos-hardware.url = "github:NixOS/nixos-hardware/master";
 	};
 
-	outputs = { self, nixpkgs, ... }@inputs: {
+	outputs = { self, nixpkgs, ... }@inputs: 
+
+let
+		nixosSystem = system: name: nixosModules: nixpkgs.lib.nixosSystem {
+			inherit system;
+			specialArgs = {inherit inputs;};
+			modules = nixosModules ++ [
+				({ config, ... }:
+				 {
+				 	networking.hostName = name;
+				 	nix = {
+				 		extraOptions = "extra-experimental-features = nix-command flakes";
+				 	};
+				 })
+				./machines/${name}
+			];
+		};
+	in {
 		nixosConfigurations = {
-			nixos = nixpkgs.lib.nixosSystem {
-				specialArgs = {inherit inputs;};
-				modules = [
-					./machines/x220-gnome/configuration.nix
-	
-						inputs.home-manager.nixosModules.default
-						{
-							home-manager.useGlobalPkgs = true;
-							home-manager.useUserPackages = true;
-							home-manager.users.pn = import ./home.nix;
-						}
-	
-				];
-			};
-			t14 = nixpkgs.lib.nixosSystem {
-				specialArgs = {inherit inputs;};
-				modules = [
-					./machines/t14
-					./modules/gnome.nix
-					inputs.nixos-hardware.nixosModules.lenovo-thinkpad-t14-amd-gen2
-					inputs.home-manager.nixosModules.default
-						{
-							home-manager.useGlobalPkgs = true;
-							home-manager.useUserPackages = true;
-							home-manager.users.pn = import ./home.nix;
-						}
-	
-				];
-			};
+			x220-gnome = nixosSystem "x86_64-linux" "x220-gnome" [
+				inputs.home-manager.nixosModules.default
+				{
+					home-manager.useGlobalPkgs = true;
+					home-manager.useUserPackages = true;
+					home-manager.users.pn = import ./home.nix;
+				}
+			];
+			t14 = nixosSystem "x86_64-linux" "t14" [
+				./modules/gnome.nix
+				inputs.nixos-hardware.nixosModules.lenovo-thinkpad-t14-amd-gen2
+				inputs.home-manager.nixosModules.default
+				{
+					home-manager.useGlobalPkgs = true;
+					home-manager.useUserPackages = true;
+					home-manager.users.pn = import ./home.nix;
+				}
+			];
 		};
 	};
 }