From 1ff53944f1e7d76b31e808c96b6f63aa6973a760 Mon Sep 17 00:00:00 2001 From: kat witch Date: Wed, 5 May 2021 15:05:48 +0100 Subject: [PATCH] project-wide: nixdirfmt --- hosts/dummy/nixos/default.nix | 2 +- profiles/common/nixos/ssh.nix | 10 ++++++++-- profiles/kat/nixos.nix | 6 ++---- profiles/sway/home/konawall.nix | 5 ++++- profiles/sway/home/sway.nix | 4 +--- services/fail2ban.nix | 2 +- services/netdata.nix | 18 ++++++------------ services/prometheus.nix | 31 +++++++++---------------------- targets/personal/default.nix | 4 ++-- users/arc/default.nix | 2 +- 10 files changed, 35 insertions(+), 49 deletions(-) diff --git a/hosts/dummy/nixos/default.nix b/hosts/dummy/nixos/default.nix index a80771e6..bb0f841b 100644 --- a/hosts/dummy/nixos/default.nix +++ b/hosts/dummy/nixos/default.nix @@ -28,7 +28,7 @@ in { "0cc3c26366cbfddfb1534b25c5655733d8f429edc941bcce674c46566fc87027"; grimoire = "2a1567a2848540070328c9e938c58d40f2b1a3f08982c15c7edc5dcabfde3330"; - boline = + boline = "89684441745467da0d1bf7f47dc74ec3ca65e05c72f752298ef3c22a22024d43"; } // (mapAttrs (_: c: c.pubkey) hexYgg); }; diff --git a/profiles/common/nixos/ssh.nix b/profiles/common/nixos/ssh.nix index 90871b52..ba781608 100644 --- a/profiles/common/nixos/ssh.nix +++ b/profiles/common/nixos/ssh.nix @@ -1,8 +1,14 @@ { config, lib, pkgs, ... }: { - katnet.public.udp.ranges = [ { from=60000; to=61000; }]; - katnet.private.udp.ranges = [ { from=60000; to=61000; }]; + katnet.public.udp.ranges = [{ + from = 60000; + to = 61000; + }]; + katnet.private.udp.ranges = [{ + from = 60000; + to = 61000; + }]; services.openssh = { enable = true; diff --git a/profiles/kat/nixos.nix b/profiles/kat/nixos.nix index 8a747cc3..42500e31 100644 --- a/profiles/kat/nixos.nix +++ b/profiles/kat/nixos.nix @@ -4,10 +4,8 @@ home-manager.users.kat = { imports = [ ./home.nix ]; }; deploy.profile.kat = true; - - users.groups = { - uinput = {}; - }; + + users.groups = { uinput = { }; }; users.users.kat = { uid = 1000; diff --git a/profiles/sway/home/konawall.nix b/profiles/sway/home/konawall.nix index ae5b4046..839b8744 100644 --- a/profiles/sway/home/konawall.nix +++ b/profiles/sway/home/konawall.nix @@ -1,5 +1,8 @@ { config, ... }: { - services.konawall = { enable = true; interval = "20m"; }; + services.konawall = { + enable = true; + interval = "20m"; + }; } diff --git a/profiles/sway/home/sway.nix b/profiles/sway/home/sway.nix index 7b71237c..56773cd8 100644 --- a/profiles/sway/home/sway.nix +++ b/profiles/sway/home/sway.nix @@ -17,9 +17,7 @@ in { home.packages = with pkgs; [ grim slurp wl-clipboard jq ]; - services.i3gopher = { - enable = true; - }; + services.i3gopher = { enable = true; }; programs.zsh.profileExtra = '' # If running from tty1 start sway diff --git a/services/fail2ban.nix b/services/fail2ban.nix index b24e6942..d9808502 100644 --- a/services/fail2ban.nix +++ b/services/fail2ban.nix @@ -4,7 +4,7 @@ services.fail2ban = { enable = true; packageFirewall = pkgs.nftables; - banaction="nftables-multiport"; + banaction = "nftables-multiport"; banaction-allports = "nftables-allports"; jails = { default = '' diff --git a/services/netdata.nix b/services/netdata.nix index 53b67a2b..630172ab 100644 --- a/services/netdata.nix +++ b/services/netdata.nix @@ -3,22 +3,16 @@ { katnet.private.tcp.ports = [ 19999 ]; - services.netdata = { - enable = true; - }; + services.netdata = { enable = true; }; - services.nginx = {# + services.nginx = { enable = true; virtualHosts = { - "${config.networking.hostName}.net.kittywit.ch" = { - useACMEHost = "${config.networking.hostName}.net.kittywit.ch"; - forceSSL = true; - locations = { - "/netdata" = { - proxyPass = "http://[::1]:19999/"; - }; + "${config.networking.hostName}.net.kittywit.ch" = { + useACMEHost = "${config.networking.hostName}.net.kittywit.ch"; + forceSSL = true; + locations = { "/netdata" = { proxyPass = "http://[::1]:19999/"; }; }; }; }; }; -}; } diff --git a/services/prometheus.nix b/services/prometheus.nix index c789a844..46fbea30 100644 --- a/services/prometheus.nix +++ b/services/prometheus.nix @@ -8,37 +8,24 @@ let (filterAttrs (_: host: host.config.services.prometheus.exporters.node.enable) hosts)); - nd_configs = - (mapAttrs (hostName: host: host.config.services.netdata) - (filterAttrs - (_: host: host.config.services.netdata.enable) - hosts)); + nd_configs = (mapAttrs (hostName: host: host.config.services.netdata) + (filterAttrs (_: host: host.config.services.netdata.enable) hosts)); in { services.prometheus = { enable = true; - scrapeConfigs = [ - { - job_name = "boline"; - static_configs = [{ targets = [ "boline.net.kittywit.ch:8002" ];}]; - } - ] ++ mapAttrsToList (hostName: prom: { + scrapeConfigs = [{ + job_name = "boline"; + static_configs = [{ targets = [ "boline.net.kittywit.ch:8002" ]; }]; + }] ++ mapAttrsToList (hostName: prom: { job_name = "${hostName}-nd"; metrics_path = "/api/v1/allmetrics"; honor_labels = true; - params = { - format = [ "prometheus" ]; - }; - static_configs = [{ - targets = [ - "${hostName}.net.kittywit.ch:19999" - ]; - }]; + params = { format = [ "prometheus" ]; }; + static_configs = [{ targets = [ "${hostName}.net.kittywit.ch:19999" ]; }]; }) nd_configs ++ mapAttrsToList (hostName: prom: { job_name = hostName; static_configs = [{ - targets = [ - "${hostName}.net.kittywit.ch:${toString prom.port}" - ]; + targets = [ "${hostName}.net.kittywit.ch:${toString prom.port}" ]; }]; }) prom_configs; }; diff --git a/targets/personal/default.nix b/targets/personal/default.nix index dba904ba..44e8e5fa 100644 --- a/targets/personal/default.nix +++ b/targets/personal/default.nix @@ -20,6 +20,6 @@ dns.records.kittywitch_net_boline = { tld = "kittywit.ch."; domain = "boline.net"; - aaaa.address = config.variables.pi_ygg.ref; - }; + aaaa.address = config.variables.pi_ygg.ref; + }; } diff --git a/users/arc/default.nix b/users/arc/default.nix index 7800a1e8..ecdab928 100644 --- a/users/arc/default.nix +++ b/users/arc/default.nix @@ -8,5 +8,5 @@ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJ8Z6briIboxIdedPGObEWB6QEQkvxKvnMW/UVU9t/ac mew-pgp" ]; shell = pkgs.zsh; - }; + }; }