aboutsummaryrefslogblamecommitdiff
path: root/modules/private/system.nix
blob: 66208c4b316f2170e5322624f1208390afcffaca (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
                                 

            
                                            









                                  



                                                                   






                                      
                               




























                                                                                          
 
                                                                         





                                  
{ 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> {};
    };

    services.journald.extraConfig = ''
      MaxLevelStore="warning"
      MaxRetentionSec="1year"
      '';

    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
    ];

  };
}