]> git.immae.eu Git - perso/Immae/Config/Nix.git/blobdiff - modules/private/system.nix
Add backup MX
[perso/Immae/Config/Nix.git] / modules / private / system.nix
index fba504e9a584dafb1fae8c609bd8439075a61a92..66208c4b316f2170e5322624f1208390afcffaca 100644 (file)
@@ -1,14 +1,21 @@
-{ pkgs, privateFiles, ... }:
+{ pkgs, lib, config, name, ... }:
 {
   config = {
+    services.duplyBackup.profiles.system = {
+      rootDir = "/var/lib";
+      excludeFile = lib.mkAfter ''
+        + /var/lib/nixos
+        + /var/lib/udev
+        + /var/lib/udisks2
+        + /var/lib/systemd
+        + /var/lib/private/systemd
+        - /var/lib
+        '';
+    };
     nixpkgs.overlays = builtins.attrValues (import ../../overlays);
     _module.args = {
       pkgsNext = import <nixpkgsNext> {};
       pkgsPrevious = import <nixpkgsPrevious> {};
-      myconfig = {
-        inherit privateFiles;
-        env = import "${privateFiles}/environment.nix";
-      };
     };
 
     services.journald.extraConfig = ''
       MaxRetentionSec="1year"
       '';
 
-    users.users.root.packages = [
-      pkgs.telnet
-      pkgs.htop
-      pkgs.iftop
-    ];
+    users.mutableUsers = false;
+    users.users.root.packages = let
+      nagios-cli = pkgs.writeScriptBin "nagios-cli" ''
+        #!${pkgs.stdenv.shell}
+        sudo -u naemon ${pkgs.nagios-cli}/bin/nagios-cli -c ${./monitoring/nagios-cli.cfg}
+        '';
+    in
+      [
+        pkgs.telnet
+        pkgs.htop
+        pkgs.iftop
+        pkgs.bind.dnsutils
+        pkgs.httpie
+        pkgs.iotop
+        pkgs.whois
+        pkgs.ngrep
+        pkgs.tcpdump
+        pkgs.tshark
+        pkgs.tcpflow
+        pkgs.mitmproxy
+        pkgs.nmap
+        pkgs.p0f
+        pkgs.socat
+        pkgs.lsof
+        pkgs.psmisc
+        pkgs.wget
+
+        pkgs.cnagios
+        nagios-cli
+      ];
 
+    environment.etc.cnagios.source = "${pkgs.cnagios}/share/doc/cnagios";
     environment.systemPackages = [
       pkgs.vim
     ];