-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathflake.nix
101 lines (88 loc) · 3.14 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
{
inputs = {
nixpkgs.url = "nixpkgs/nixos-unstable";
nixpkgs-master.url = "github:nixos/nixpkgs";
nixpkgs-24-11.url = "github:nixos/nixpkgs/nixos-24.11";
srvos.url = "github:nix-community/srvos";
srvos.inputs.nixpkgs.follows = "nixpkgs";
nix.url = "github:nixos/nix/2.23.4";
utils.url = "github:numtide/flake-utils";
filters.url = "github:numtide/nix-filter";
cottand = {
url = "github:cottand/home-nix";
inputs.nixpkgs.follows = "nixpkgs-master";
inputs.home-manager.follows = "home-manager";
};
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
attic = {
url = "github:zhaofengli/attic";
inputs.nixpkgs.follows = "nixpkgs";
};
colmena = {
url = "github:zhaofengli/colmena";
inputs.nixpkgs.follows = "nixpkgs";
};
go-cache = {
url = "github:numtide/build-go-cache";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = inputs@{ self, nixpkgs, cottand, home-manager, utils, attic, filters, go-cache, colmena, ... }:
let
colmenaHive = colmena.lib.makeHive self.outputs.colmena;
overlays = [
overrides
attic.overlays.default
filters.overlays.default
colmena.overlays.default
];
overrides = final: prev:
let
goCachePkgs = go-cache.legacyPackages.${prev.system};
selfPkgs = self.legacyPackages.${prev.system};
pkgs2411 = (import inputs.nixpkgs-24-11 { system = prev.system; config.allowUnfree = true; });
in
{
inherit (goCachePkgs) buildGoCache get-external-imports;
inherit (selfPkgs) scripts util;
nixVersions = prev.nixVersions // {
# .. which was removed in unstable, but compiles with gonix
nix_2_23 = inputs.nix.packages.${prev.system}.nix;
};
vault-bin = (import inputs.nixpkgs-master { system = prev.system; config.allowUnfree = true; }).vault-bin;
};
in
(utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system overlays;
config.allowUnfree = true;
};
pkgsWithSelf = pkgs // { inherit self; };
in
rec {
legacyPackages.services = (import ./dev-go/services) pkgs;
legacyPackages.scripts = (import ./scripts) pkgsWithSelf;
legacyPackages.util = (import ./util.nix) pkgsWithSelf;
legacyPackages.images = (import ./images.nix) pkgsWithSelf;
packages = legacyPackages.scripts;
devShells.default = (import ./shell.nix) pkgsWithSelf;
checks = (import ./checks.nix) pkgsWithSelf;
formatter = pkgs.writeShellScriptBin "fmt" ''
${pkgs.nomad}/bin/nomad fmt
${pkgs.terraform}/bin/terraform fmt
'';
}
)) // {
colmenaHive = colmenaHive // {
findByTag = with builtins; tag:
filter (name: elem tag colmenaHive.nodes.${name}.config.deployment.tags) (attrNames colmenaHive.nodes);
};
colmena = (import ./hive.nix) (inputs // { inherit overlays; });
rootCa = ./certs/root_2024_ca.crt;
}
;
}