{ pkgs, lib, config, ... }: let inherit (lib) types; in { imports = [ ./modules.nix ./defaults/predictable-interface-names.nix ]; config = { nix = { autoOptimiseStore = true; #binaryCaches = lib.mkForce []; extraOptions = '' ''; # Use gc.automatic to keep disk space under control. gc = { automatic = true; dates = "weekly"; options = "--delete-older-than 30d"; }; nixPath = [ "nixpkgs=${pkgs.path}" ]; }; nixpkgs = { config = { allowUnfree = false; /* packageOverrides = pkgs: { postfix = pkgs.postfix.override { withLDAP = true; }; }; */ }; #overlays = import ../overlays.nix; }; documentation.nixos = { enable = false; # NOTE: useless on a server, and CPU intensive. }; # Clean /tmp automatically on boot. boot.cleanTmpDir = true; time = { timeZone = "Europe/Paris"; }; i18n = { consoleFont = "Lat2-Terminus16"; consoleKeyMap = "fr"; defaultLocale = "fr_FR.UTF-8"; }; services = { openssh = { enable = true; passwordAuthentication = false; extraConfig = '' ''; }; journald = { extraConfig = '' SystemMaxUse=50M ''; }; }; environment = { systemPackages = with pkgs; [ binutils dnsutils htop inetutils iotop lsof mailutils multitail ncdu pv swaplist tcpdump tmux tree vim which ]; etc."inputrc".text = lib.readFile defaults/readline/inputrc; }; programs = { bash = { interactiveShellInit = '' bind '"\e[A":history-search-backward' bind '"\e[B":history-search-forward' # Ignore duplicate commands, ignore commands starting with a space export HISTCONTROL=erasedups:ignorespace export HISTSIZE=42000 # Append to the history instead of overwriting (good for multiple connections) shopt -s histappend ''; shellAliases = { cl = "clear"; l = "ls -alh"; ll = "ls -l"; ls = "ls --color=tty"; mem = "ps -e -orss=,user=,args= | sort -b -k1,1n"; s="sudo systemctl"; s-u="systemctl --user"; nixos-clean="sudo nix-collect-garbage -d"; nixos-history="sudo nix-env --list-generations --profile /nix/var/nix/profiles/system"; nixos-rollback="sudo nixos-rebuild switch --rollback"; nixos-update="sudo nix-channel --update"; nixos-upgrade="sudo nixos-rebuild switch"; nixos-upstream="sudo nix-channel --list"; }; }; mtr.enable = true; }; }; }