Compare commits
3 commits
f63c95e4d9
...
c47437116b
Author | SHA1 | Date | |
---|---|---|---|
c47437116b | |||
46b550781e | |||
cbdbed1099 |
7 changed files with 39 additions and 20 deletions
10
hive.nix
10
hive.nix
|
@ -49,6 +49,8 @@ let
|
|||
};
|
||||
|
||||
meta = (import ./meta) lib;
|
||||
|
||||
nodeMeta = meta.nodes.${node};
|
||||
};
|
||||
in
|
||||
|
||||
|
@ -64,16 +66,16 @@ in
|
|||
};
|
||||
|
||||
defaults =
|
||||
{ meta, name, ... }:
|
||||
{ name, nodeMeta, ... }:
|
||||
{
|
||||
# Import the default modules
|
||||
imports = [ ./modules ];
|
||||
|
||||
# Include default secrets
|
||||
age-secrets.sources = [ (./machines + "/${name}/secrets") ];
|
||||
age-secrets.sources = [ ./machines/${name}/secrets ];
|
||||
|
||||
# Deployment config is specified in meta.nodes.${node}.deployment
|
||||
inherit (meta.nodes.${name}) deployment;
|
||||
inherit (nodeMeta) deployment;
|
||||
|
||||
nix = {
|
||||
# Set NIX_PATH to the patched version of nixpkgs
|
||||
|
@ -92,7 +94,7 @@ in
|
|||
|
||||
# Use the stateVersion declared in the metadata
|
||||
system = {
|
||||
inherit (meta.nodes.${name}) stateVersion;
|
||||
inherit (nodeMeta) stateVersion;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -26,6 +26,8 @@
|
|||
|
||||
stateVersion = "23.05";
|
||||
vm-cluster = "Hyperviseur NPS";
|
||||
|
||||
nix-modules = [ "services/crabfit" ];
|
||||
};
|
||||
|
||||
compute01 = {
|
||||
|
@ -53,6 +55,8 @@
|
|||
storage01 = {
|
||||
site = "pav01";
|
||||
stateVersion = "23.11";
|
||||
|
||||
nix-modules = [ "services/forgejo-nix-runners" ];
|
||||
};
|
||||
|
||||
vault01 = {
|
||||
|
|
|
@ -95,6 +95,14 @@ in
|
|||
'';
|
||||
};
|
||||
|
||||
nix-modules = mkOption {
|
||||
type = listOf str;
|
||||
default = [ ];
|
||||
description = ''
|
||||
List of modules to import from [nix-modules](https://git.hubrecht.ovh/hubrecht/nix-modules).
|
||||
'';
|
||||
};
|
||||
|
||||
admins = mkOption {
|
||||
type = listOf str;
|
||||
default = [ ];
|
||||
|
|
|
@ -32,7 +32,12 @@
|
|||
# pris connaissance de la licence CeCILL, et que vous en avez accepté les
|
||||
# termes.
|
||||
|
||||
{ lib, sources, ... }:
|
||||
{
|
||||
lib,
|
||||
nodeMeta,
|
||||
sources,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
imports =
|
||||
|
@ -57,11 +62,12 @@
|
|||
"${sources.attic}/nixos/atticd.nix"
|
||||
"${sources.arkheon}/module.nix"
|
||||
]
|
||||
++ ((import sources.nix-modules { inherit lib; }).importModules [
|
||||
"age-secrets"
|
||||
"services/crabfit"
|
||||
"services/forgejo-nix-runners"
|
||||
"services/bupstash"
|
||||
"services/systemd-notify"
|
||||
]);
|
||||
++ ((import sources.nix-modules { inherit lib; }).importModules (
|
||||
[
|
||||
"age-secrets"
|
||||
"services/bupstash"
|
||||
"services/systemd-notify"
|
||||
]
|
||||
++ nodeMeta.nix-modules
|
||||
));
|
||||
}
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
config,
|
||||
lib,
|
||||
meta,
|
||||
name,
|
||||
nodeMeta,
|
||||
...
|
||||
}:
|
||||
|
||||
|
@ -49,7 +49,6 @@ let
|
|||
types
|
||||
;
|
||||
|
||||
nodeMeta = meta.nodes.${name};
|
||||
admins =
|
||||
meta.organization.groups.root
|
||||
++ nodeMeta.admins
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
{
|
||||
config,
|
||||
meta,
|
||||
name,
|
||||
lib,
|
||||
nodeMeta,
|
||||
...
|
||||
}:
|
||||
let
|
||||
|
@ -24,13 +23,13 @@ in
|
|||
register = true;
|
||||
update_all = true;
|
||||
virtual = {
|
||||
enabled = meta.nodes.${name}.vm-cluster != null;
|
||||
cluster_name = meta.nodes.${name}.vm-cluster;
|
||||
enabled = nodeMeta.vm-cluster != null;
|
||||
cluster_name = nodeMeta.vm-cluster;
|
||||
};
|
||||
purge_old_devices = true;
|
||||
hostname_cmd = "echo ${hostName}.${domain}";
|
||||
datacenter_location = {
|
||||
driver = "cmd:echo ${meta.nodes.${name}.site}";
|
||||
driver = "cmd:echo ${nodeMeta.site}";
|
||||
regex = "(.*)";
|
||||
};
|
||||
device = {
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
lib,
|
||||
meta,
|
||||
name,
|
||||
nodeMeta,
|
||||
...
|
||||
}:
|
||||
|
||||
|
@ -42,7 +43,7 @@ in
|
|||
inherit (net') hostId;
|
||||
|
||||
hostName = name;
|
||||
domain = "${meta.nodes.${name}.site}.infra.dgnum.eu";
|
||||
domain = "${nodeMeta.site}.infra.dgnum.eu";
|
||||
useNetworkd = true;
|
||||
|
||||
firewall.logRefusedConnections = false;
|
||||
|
|
Loading…
Reference in a new issue