Add formatter & reformat.
This commit is contained in:
@@ -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 [ ];
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user