From f8bccd8508f8df3b4546133839d9fea9b491291b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Mon, 2 Jan 2023 17:15:14 +0100 Subject: [PATCH] Format --- modules/cluster/default.nix | 51 ++++++++++++++++++++----------------- 1 file changed, 28 insertions(+), 23 deletions(-) diff --git a/modules/cluster/default.nix b/modules/cluster/default.nix index ce95a97e..baea976e 100644 --- a/modules/cluster/default.nix +++ b/modules/cluster/default.nix @@ -17,16 +17,19 @@ let ) null [ "cluster" "serv" ]; in { # Open firewall between cluster members - networking.firewall.extraCommands = lib.concatMapStrings (server: - let - netConfig = zentralwerk.lib.config.site.net.${serverNet server}; - in - lib.optionalString (server != hostName) '' - iptables -A nixos-fw --source ${netConfig.hosts4.${server}} -j ACCEPT - ${lib.concatMapStrings (hosts6: '' - ip6tables -A nixos-fw --source ${hosts6.${server}} -j ACCEPT - '') (builtins.attrValues netConfig.hosts6)} - '') servers; + networking.firewall.extraCommands = lib.concatMapStrings + (server: + let + netConfig = zentralwerk.lib.config.site.net.${serverNet server}; + in + lib.optionalString (server != hostName) '' + iptables -A nixos-fw --source ${netConfig.hosts4.${server}} -j ACCEPT + ${lib.concatMapStrings (hosts6: '' + ip6tables -A nixos-fw --source ${hosts6.${server}} -j ACCEPT + '') (builtins.attrValues netConfig.hosts6)} + '' + ) + servers; # Cluster configuration skyflake = { @@ -42,23 +45,25 @@ in { inherit servers; # run tasks only on these: client.enable = builtins.elem hostName microvmServers; - client.meta = - lib.optionalAttrs (builtins.elem hostName storageServers) { - "c3d2.storage" = "big"; - }; + client.meta = lib.optionalAttrs (builtins.elem hostName storageServers) { + "c3d2.storage" = "big"; + }; }; microvmUid = 997; - users.c3d2 = { - uid = 1001; - sshKeys = config.users.users.root.openssh.authorizedKeys.keys; - }; - users.leon = { - uid = 1002; - sshKeys = with (import ../../ssh-public-keys.nix).users; - leon ++ - astro; + users = { + c3d2 = { + uid = 1001; + sshKeys = config.users.users.root.openssh.authorizedKeys.keys; + }; + leon = { + uid = 1002; + sshKeys = with (import ../../ssh-public-keys.nix).users; + leon ++ + astro; + }; }; + deploy.customizationModule = ./deployment.nix; storage.glusterfs = {