about summary refs log tree commit diff
path: root/flake.nix
diff options
context:
space:
mode:
authorPatryk Niedźwiedziński <pniedzwiedzinski19@gmail.com>2024-09-29 19:11:26 +0200
committerPatryk Niedźwiedziński <pniedzwiedzinski19@gmail.com>2024-09-29 19:11:26 +0200
commit97d707555691ab87204fa00d7777cb62a88823e8 (patch)
treebfe6952bf1f6084b4320438e78608e79b43fd5c8 /flake.nix
parenta54a53f2fe94dcfb7fcf72337364352066050c1d (diff)
downloaddots-97d707555691ab87204fa00d7777cb62a88823e8.tar.gz
dots-97d707555691ab87204fa00d7777cb62a88823e8.zip
t14: 27 current 2024-09-29 19:11:23 24.05.20240928.fbca5e7 6.6.52 *
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;
+				}
+			];
 		};
 	};
 }