-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
79 lines (75 loc) · 2.05 KB
/
flake.nix
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
{
description = "Nix hash collection infra";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
colmena = {
url = "github:zhaofengli/colmena";
inputs = {
flake-utils.follows = "flake-utils";
nixpkgs.follows = "nixpkgs";
stable.follows = "nixpkgs";
};
};
flake-utils.url = "github:numtide/flake-utils";
disko = {
url = "github:nix-community/disko";
inputs.nixpkgs.follows = "nixpkgs";
};
agenix.url = "github:ryantm/agenix";
proxmox-nixos-update.url = "github:SaumonNet/proxmox-nixos-update";
};
outputs =
{
self,
nixpkgs,
flake-utils,
colmena,
disko,
agenix,
proxmox-nixos-update,
...
}@inputs:
let
lib = nixpkgs.lib;
in
{
nixosConfigurations = builtins.mapAttrs (
name: value:
nixpkgs.lib.nixosSystem {
lib = lib;
system = "x86_64-linux";
specialArgs = {
inherit inputs;
proxmox-nixos-update = proxmox-nixos-update.packages.x86_64-linux.default;
};
modules = [
value
disko.nixosModules.disko
agenix.nixosModules.default
];
extraModules = [ inputs.colmena.nixosModules.deploymentOptions ];
}
) { proxmox-nixos-infra = import ./configuration.nix; };
colmena = {
meta = {
nixpkgs = import inputs.nixpkgs { system = "x86_64-linux"; };
nodeSpecialArgs = builtins.mapAttrs (_: v: v._module.specialArgs) self.nixosConfigurations;
specialArgs.lib = lib;
};
} // builtins.mapAttrs (_: v: { imports = v._module.args.modules; }) self.nixosConfigurations;
}
// flake-utils.lib.eachDefaultSystem (
system:
let
pkgs = nixpkgs.legacyPackages.${system};
in
{
devShell = pkgs.mkShell {
buildInputs = with pkgs; [
colmena.packages.${system}.colmena
agenix.packages.${system}.default
];
};
}
);
}