diff options
Diffstat (limited to 'modules/system/sysops.nix')
-rw-r--r-- | modules/system/sysops.nix | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/modules/system/sysops.nix b/modules/system/sysops.nix new file mode 100644 index 0000000..ccf6d0b --- /dev/null +++ b/modules/system/sysops.nix @@ -0,0 +1,35 @@ +{ config, lib, ...}: +let + + inherit (lib) concatMapStringsSep concatStringsSep mkOption types; + inherit (types) str listOf; + + bindir = "/run/current-system/sw/bin"; + + commands = concatStringsSep ", " ( + [ + "${bindir}/du *" + "${bindir}/iftop" + "${bindir}/iotop" + "${bindir}/ip6tables -L*" + "${bindir}/ipsec *" + "${bindir}/iptables -L*" + "${bindir}/journalctl *" + "${bindir}/lsof *" + "${bindir}/mtr *" + "${bindir}/nix-collect-garbage *" + "${bindir}/nmap *" + "${bindir}/tcpdump *" + "${bindir}/traceroute *" + ] ++ map (c: "${bindir}/systemctl ${c} *") + [ "kill" "reload" "restart" "start" "status" "stop" ] + ); + +in { + + config = { + security.sudo.extraConfig = '' + %wheel ALL=(ALL) NOPASSWD: ${commands} + ''; + }; +} |