X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;ds=sidebyside;f=modules%2Fprivate%2Fsystem%2Fmonitoring-1.nix;h=192aa93d7217c9c1afdea5e13aaa178858f5bb11;hb=05becbbb4be5cd18cb12d60a2d2bc0fbcda74fe4;hp=dea5f45993daf1f31e896172933c7ba214e89bdf;hpb=792ccef2c82a055a2cc4801de028312b0b1199ea;p=perso%2FImmae%2FConfig%2FNix.git diff --git a/modules/private/system/monitoring-1.nix b/modules/private/system/monitoring-1.nix index dea5f45..192aa93 100644 --- a/modules/private/system/monitoring-1.nix +++ b/modules/private/system/monitoring-1.nix @@ -1,8 +1,8 @@ -{ config, pkgs, resources, ... }: +{ config, pkgs, lib, resources, ... }: { deployment = { targetUser = "root"; - targetHost = config.hostEnv.ips.main.ip4; + targetHost = lib.head config.hostEnv.ips.main.ip4; substituteOnDestination = true; }; # ssh-keyscan monitoring-1 | nix-shell -p ssh-to-age --run ssh-to-age @@ -17,9 +17,9 @@ myServices.status.enable = true; networking = { firewall.enable = true; - interfaces."ens3".ipv4.addresses = pkgs.lib.attrsets.mapAttrsToList - (n: ips: { address = ips.ip4; prefixLength = 32; }) - (pkgs.lib.attrsets.filterAttrs (n: v: n != "main") config.hostEnv.ips); + interfaces."ens3".ipv4.addresses = pkgs.lib.flatten (pkgs.lib.attrsets.mapAttrsToList + (n: ips: map (ip: { address = ip; prefixLength = 32; }) (ips.ip4 or [])) + (pkgs.lib.attrsets.filterAttrs (n: v: n != "main") config.hostEnv.ips)); interfaces."ens3".ipv6.addresses = pkgs.lib.flatten (pkgs.lib.attrsets.mapAttrsToList (n: ips: map (ip: { address = ip; prefixLength = (if n == "main" && ip == pkgs.lib.head ips.ip6 then 64 else 128); }) (ips.ip6 or [])) config.hostEnv.ips);