summary refs log tree commit diff
path: root/flake.nix
diff options
context:
space:
mode:
authorMel <einebeere@gmail.com>2024-10-14 22:15:32 +0200
committerMel <einebeere@gmail.com>2024-10-14 22:15:32 +0200
commit7bca7fb6cac0a3d6479ee8dd8fb5f13fa0261a51 (patch)
treeced025aff19ffe1a9a040f3e8034a48a88285b3a /flake.nix
downloadminerals-7bca7fb6cac0a3d6479ee8dd8fb5f13fa0261a51.tar.zst
minerals-7bca7fb6cac0a3d6479ee8dd8fb5f13fa0261a51.zip
Break up configuration for multiple machines
Signed-off-by: Mel <einebeere@gmail.com>
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix49
1 files changed, 49 insertions, 0 deletions
diff --git a/flake.nix b/flake.nix
new file mode 100644
index 0000000..a37fc66
--- /dev/null
+++ b/flake.nix
@@ -0,0 +1,49 @@
+{
+  inputs = {
+    nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05";
+
+    nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable";
+
+    home-manager = {
+      url = "github:nix-community/home-manager/release-24.05";
+      inputs.nixpkgs.follows = "nixpkgs";
+    };
+  };
+
+  outputs = inputs @ { self, nixpkgs, nixpkgs-unstable, home-manager }:
+  let
+    system = "x86_64-linux";
+
+    machines = [
+      "grimoire"
+      "bismuth"
+    ];
+    
+    packageSets = let
+      pkgsInputs = { inherit system; config = import ./config.nix; };
+    in rec {
+      pkgs = import nixpkgs pkgsInputs;
+      unstablePkgs = import nixpkgs-unstable pkgsInputs;
+      auxiliaryPkgs = import ./pkgs { inherit pkgs unstablePkgs; };
+    };
+
+  in {
+    nixosConfigurations = nixpkgs.lib.genAttrs machines
+      (machine: nixpkgs.lib.nixosSystem {
+        inherit system;
+
+        specialArgs = inputs // packageSets;
+
+        modules = [
+          ./machines/${machine}.nix
+        
+          home-manager.nixosModules.home-manager {
+            home-manager.useGlobalPkgs = true;
+            home-manager.useUserPackages = true;
+            home-manager.users.mel = import ./home.nix;
+          }
+        ];
+      }
+    );
+  };
+}