summary refs log tree commit diff
path: root/flake.nix
diff options
context:
space:
mode:
authorMel <einebeere@gmail.com>2024-10-26 17:44:36 +0200
committerMel <einebeere@gmail.com>2024-10-26 17:44:36 +0200
commit1e0eca0bcbfc338a585842c65c4b48d62d79728d (patch)
tree9ab21421d798f0812c966532d8c10bb5c8384e81 /flake.nix
downloadnetwork-1e0eca0bcbfc338a585842c65c4b48d62d79728d.tar.zst
network-1e0eca0bcbfc338a585842c65c4b48d62d79728d.zip
Glued together corsac configuration
Signed-off-by: Mel <einebeere@gmail.com>
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix56
1 files changed, 56 insertions, 0 deletions
diff --git a/flake.nix b/flake.nix
new file mode 100644
index 0000000..82f0f09
--- /dev/null
+++ b/flake.nix
@@ -0,0 +1,56 @@
+{
+  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";
+    };
+
+    flake-compat.url = "github:edolstra/flake-compat";
+  };
+
+  outputs = inputs @ { self, nixpkgs, nixpkgs-unstable, home-manager, ... }:
+  let
+    system = "x86_64-linux";
+
+    machines = [
+      "corsac"
+    ];
+    
+    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 // {
+          me = machine;
+          security = import ./security.nix;
+        };
+
+        modules = [
+          ./machines/${machine}
+        
+          home-manager.nixosModules.home-manager {
+            home-manager.useGlobalPkgs = true;
+            home-manager.useUserPackages = true;
+            home-manager.users.mel = import ./machines/${machine}/home.nix;
+          }
+        ];
+      }
+    );
+
+    # compatibility wrapper for nixos-option
+    legacyPackages.${system} = with packageSets; pkgs.recurseIntoAttrs pkgs;
+  };
+}