summary refs log tree commit diff
path: root/flake.nix
blob: 0d04ff904cce7f68cbbaeb4d81a63de4a03c89c0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
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 = [
      "graphite"
      "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}
        
          home-manager.nixosModules.home-manager {
            home-manager.useGlobalPkgs = true;
            home-manager.useUserPackages = true;
            home-manager.users.mel = import ./machines/${machine}/home.nix;
          }
        ];
      }
    );
  };
}