Add formatter & reformat.

This commit is contained in:
2024-09-13 13:38:15 +01:00
parent 20212556e5
commit 457efb9bb6
29 changed files with 363 additions and 205 deletions

View File

@@ -1,7 +1,11 @@
# inspiration: https://github.com/astro/skyflake/blob/main/nixos-modules/nomad.nix
{ pkgs, config, ... }:
let
servers = [ "c1" "c2" "c3" ];
servers = [
"c1"
"c2"
"c3"
];
server_enabled = builtins.elem config.networking.hostName servers;
in
{
@@ -58,7 +62,7 @@ in
allow_privileged = true;
# for keepalived, though only really needing "NET_ADMIN","NET_BROADCAST","NET_RAW" on top of default
# TODO: trim this down
allow_caps = ["all"];
allow_caps = [ "all" ];
volumes.enabled = true;
extra_labels = [
"job_name"
@@ -83,7 +87,15 @@ in
];
networking.firewall = {
allowedTCPPorts = if server_enabled then [ 4646 4647 4648 ] else [ 4646 ];
allowedUDPPorts = if server_enabled then [ 4648 ] else [];
allowedTCPPorts =
if server_enabled then
[
4646
4647
4648
]
else
[ 4646 ];
allowedUDPPorts = if server_enabled then [ 4648 ] else [ ];
};
}