-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
188 lines (162 loc) · 5.76 KB
/
flake.nix
File metadata and controls
188 lines (162 loc) · 5.76 KB
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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
{
inputs = {
# Track channels with commits tested and built by hydra
nixpkgs.url = "github:nixos/nixpkgs/nixos-25.11";
unstable.url = "github:nixos/nixpkgs/nixos-unstable";
anubis-rollback.url = "github:nixos/nixpkgs/08dacfca559e1d7da38f3cf05f1f45ee9bfd213c";
fork.url = "github:teutat3s/nixpkgs/init-matrix-authentication-service-module-0.13.0";
codeberg-pages.url = "github:nixos/nixpkgs/refs/pull/395725/head";
nix-darwin.url = "github:lnl7/nix-darwin/master";
nix-darwin.inputs.nixpkgs.follows = "nixpkgs";
home-manager.url = "github:nix-community/home-manager/release-25.11";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
flake-parts.url = "github:hercules-ci/flake-parts";
deploy-rs.url = "github:serokell/deploy-rs";
deploy-rs.inputs.nixpkgs.follows = "nixpkgs";
disko.url = "github:nix-community/disko";
disko.inputs.nixpkgs.follows = "nixpkgs";
agenix.url = "github:ryantm/agenix";
agenix.inputs.nixpkgs.follows = "nixpkgs";
agenix.inputs.darwin.follows = "nix-darwin";
agenix.inputs.home-manager.follows = "home-manager";
keycloak-theme-pub-solar.url = "git+https://git.pub.solar/pub-solar/keycloak-theme?ref=main";
keycloak-theme-pub-solar.inputs.nixpkgs.follows = "nixpkgs";
keycloak-event-listener.url = "git+https://git.pub.solar/pub-solar/keycloak-event-listener?ref=main";
keycloak-event-listener.inputs.nixpkgs.follows = "unstable";
element-themes.url = "github:aaronraimist/element-themes/master";
element-themes.flake = false;
maunium-stickerpicker.url = "github:maunium/stickerpicker?ref=master";
maunium-stickerpicker.flake = false;
element-stickers.url = "git+https://git.pub.solar/pub-solar/maunium-stickerpicker-nix?ref=main";
element-stickers.inputs.maunium-stickerpicker.follows = "maunium-stickerpicker";
element-stickers.inputs.nixpkgs.follows = "nixpkgs";
simple-nixos-mailserver.url = "gitlab:simple-nixos-mailserver/nixos-mailserver/nixos-25.11";
simple-nixos-mailserver.inputs.nixpkgs.follows = "nixpkgs";
# NOTE: The ref needs to be compatible with mastodon version we have.
tangerine-ui.url = "github:nileane/TangerineUI-for-Mastodon?ref=v2.5.3";
tangerine-ui.flake = false;
};
outputs =
inputs@{ self, ... }:
inputs.flake-parts.lib.mkFlake { inherit inputs; } {
systems = [
"x86_64-linux"
"aarch64-linux"
];
imports = [
./logins
./lib
./overlays
./hosts
];
perSystem =
args@{
system,
pkgs,
config,
lib,
...
}:
{
_module.args = {
inherit inputs;
pkgs = import inputs.nixpkgs {
inherit system;
overlays = [ inputs.agenix.overlays.default ];
};
unstable = import inputs.unstable { inherit system; };
};
checks =
let
machinesPerSystem = {
x86_64-linux = [
"blue-shell"
"delite"
"nachtigall"
"tankstelle"
"trinkgenossin"
"underground"
];
};
nixosMachines = inputs.nixpkgs.lib.mapAttrs' (n: inputs.nixpkgs.lib.nameValuePair "nixos-${n}") (
inputs.nixpkgs.lib.genAttrs (machinesPerSystem.${system} or [ ]) (
name: self.nixosConfigurations.${name}.config.system.build.toplevel
)
);
in
import ./tests {
inherit
config
inputs
lib
pkgs
self
system
;
}
// nixosMachines;
packages.nginx-dhparam-ffdhe2048 = pkgs.callPackage ./overlays/pkgs/nginx-dhparam-ffdhe2048 { };
devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [
deploy-rs
nix-fast-build
agenix
age-plugin-yubikey
cachix
editorconfig-checker
nix-diff
nodePackages.prettier
nvfetcher
shellcheck
shfmt
treefmt
nixos-generators
opentofu
terraform-backend-git
terraform-ls
jq
# For the tests puppeteer-socket pkg
nodejs
nodePackages.typescript
nodePackages.typescript-language-server
];
};
devShells.ci = pkgs.mkShell { buildInputs = with pkgs; [ nodejs ]; };
formatter = pkgs.nixfmt-rfc-style;
};
flake = {
nixosModules = builtins.listToAttrs (
map (x: {
name = x;
value = import (./modules + "/${x}");
}) (builtins.attrNames (builtins.readDir ./modules))
);
checks = builtins.mapAttrs (
system: deployLib: deployLib.deployChecks self.deploy
) inputs.deploy-rs.lib;
deploy.nodes = self.lib.deploy.mkDeployNodes self.nixosConfigurations {
nachtigall = {
hostname = "nachtigall.wg.pub.solar";
};
metronom = {
hostname = "metronom.wg.pub.solar";
};
tankstelle = {
hostname = "tankstelle.wg.pub.solar";
};
underground = {
hostname = "80.244.242.3";
};
trinkgenossin = {
hostname = "trinkgenossin.wg.pub.solar";
};
delite = {
hostname = "delite.wg.pub.solar";
};
blue-shell = {
hostname = "blue-shell.wg.pub.solar";
};
};
};
};
}