-
Notifications
You must be signed in to change notification settings - Fork 3
/
hive.nix
37 lines (34 loc) · 945 Bytes
/
hive.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
# SPDX-FileCopyrightText: 2023 Chris Montgomery <[email protected]>
# SPDX-License-Identifier: GPL-3.0-or-later
# Ref: <https://github.com/zhaofengli/colmena/issues/60#issuecomment-1510496861>
#
# TODO: make sure this does not confuse the `colmena` CLI, which might give
# //hive.nix special treatment.
{ self, inputs, ... }:
let
inherit (self.lib.colmena) mkNode metaFor;
l = inputs.nixpkgs.lib // builtins;
configurations = l.removeAttrs self.nixosConfigurations [ "bootstrap-graphical" ];
mkNode' = n: mkNode configurations.${n} n;
mkHive = nodes: (l.mapAttrs mkNode' nodes) // (metaFor (l.intersectAttrs nodes configurations));
in
{
flake.colmena = mkHive {
gabbro = {
tags = [
"@seadome"
"@loopgarden"
"@hetznerCloud"
"@fsn-1"
];
};
hierophant = {
tags = [
"@seadome"
"@loopgarden"
"@hetznerCloud"
"@us-east"
];
};
};
}