forked from nix-community/infra
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
124 lines (107 loc) · 4.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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
{
description = "NixOS configuration of our builders";
nixConfig.extra-substituters = [
"https://nix-community.cachix.org"
"https://nixpkgs-update.cachix.org"
];
nixConfig.extra-trusted-public-keys = [
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
"nixpkgs-update.cachix.org-1:6y6Z2JdoL3APdu6/+Iy8eZX2ajf09e4EE9SnxSML1W8="
];
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable-small";
flake-parts.url = "github:hercules-ci/flake-parts";
flake-parts.inputs.nixpkgs-lib.follows = "nixpkgs";
sops-nix.url = "github:Mic92/sops-nix";
sops-nix.inputs.nixpkgs.follows = "nixpkgs";
sops-nix.inputs.nixpkgs-stable.follows = "";
srvos.url = "github:numtide/srvos";
# actually not used when using the modules but than nothing ever will try to fetch this nixpkgs variant
srvos.inputs.nixpkgs.follows = "nixpkgs";
nixpkgs-update.url = "github:ryantm/nixpkgs-update";
nixpkgs-update.inputs.mmdoc.follows = "";
nixpkgs-update-github-releases.url = "github:ryantm/nixpkgs-update-github-releases";
nixpkgs-update-github-releases.flake = false;
nur-update.url = "github:nix-community/nur-update";
nur-update.inputs.nixpkgs.follows = "nixpkgs";
disko.url = "github:nix-community/disko";
disko.inputs.nixpkgs.follows = "nixpkgs";
hercules-ci-effects.url = "github:hercules-ci/hercules-ci-effects";
hercules-ci-effects.inputs.flake-parts.follows = "flake-parts";
hercules-ci-effects.inputs.hercules-ci-agent.follows = "";
hercules-ci-effects.inputs.nixpkgs.follows = "nixpkgs";
treefmt-nix.url = "github:numtide/treefmt-nix";
treefmt-nix.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = inputs @ { flake-parts, self, ... }:
flake-parts.lib.mkFlake
{ inherit inputs; }
{
systems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
herculesCI = { lib, ... }: {
ciSystems = [ "x86_64-linux" "aarch64-linux" ];
onPush.default.outputs = {
checks = lib.mkForce self.outputs.checks.x86_64-linux;
};
};
imports = [
inputs.hercules-ci-effects.flakeModule
inputs.treefmt-nix.flakeModule
./effect.nix
./shell.nix
];
perSystem.treefmt.imports = [ ./treefmt.nix ];
flake.nixosConfigurations =
let
inherit (inputs.nixpkgs.lib) nixosSystem;
common = [
{ _module.args.inputs = inputs; }
{ srvos.flake = inputs.self; }
inputs.sops-nix.nixosModules.sops
inputs.srvos.nixosModules.server
inputs.srvos.nixosModules.mixins-telegraf
{ networking.firewall.allowedTCPPorts = [ 9273 ]; }
];
in
{
build01 = nixosSystem {
system = "x86_64-linux";
modules =
common
++ [
./build01/configuration.nix
inputs.srvos.nixosModules.hardware-hetzner-online-amd
];
};
build02 = nixosSystem {
system = "x86_64-linux";
modules =
common
++ [
./build02/configuration.nix
inputs.srvos.nixosModules.mixins-nginx
inputs.srvos.nixosModules.hardware-hetzner-online-amd
];
};
build03 = nixosSystem {
system = "x86_64-linux";
modules =
common
++ [
./build03/configuration.nix
inputs.srvos.nixosModules.mixins-nginx
inputs.srvos.nixosModules.hardware-hetzner-online-amd
];
};
build04 = nixosSystem {
system = "aarch64-linux";
modules =
common
++ [
./build04/configuration.nix
inputs.disko.nixosModules.disko
];
};
};
};
}