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.nix44
1 files changed, 23 insertions, 21 deletions
diff --git a/flake.nix b/flake.nix
index 3618e4a..bbabfb3 100644
--- a/flake.nix
+++ b/flake.nix
@@ -13,21 +13,23 @@
 
 	outputs = { self, nixpkgs, ... }@inputs: 
 
-let
+		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}
-			];
-		};
+		inherit system;
+		specialArgs = {inherit inputs;};
+		modules = nixosModules ++ [
+			({ config, pkgs, ... }:
+		let rebuild = pkgs.writeShellScriptBin "rebuild" (builtins.readFile ./rebuild.sh); in
+			 {
+			 networking.hostName = name;
+			environment.systemPackages = [ rebuild ];
+			 nix = {
+			 extraOptions = "extra-experimental-features = nix-command flakes";
+			 };
+			 })
+		./machines/${name}
+		];
+	};
 	in {
 		nixosConfigurations = {
 			x220-gnome = nixosSystem "x86_64-linux" "x220-gnome" [
@@ -40,13 +42,13 @@ let
 			];
 			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;
-				}
+					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;
+					}
 			];
 		};
 	};