1 { pkgs, lib, config, ... }:
2 let inherit (lib) types;
7 defaults/predictable-interface-names.nix
11 #binaryCaches = lib.mkForce [];
14 # Use gc.automatic to keep disk space under control.
18 options = "--delete-older-than 30d";
21 ("nixpkgs=" + toString pkgs.path)
29 packageOverrides = pkgs: {
30 postfix = pkgs.postfix.override {
36 overlays = import ./overlays.nix;
39 documentation.nixos = {
40 enable = false; # NOTE: useless on a server, and CPU intensive.
43 # Clean /tmp automatically on boot.
44 boot.cleanTmpDir = true;
47 timeZone = "Europe/Paris";
51 defaultLocale = "fr_FR.UTF-8";
55 font = "Lat2-Terminus16";
59 # Always try to start all the units (default.target)
60 # because systemd's emergency shell does not try to start sshd.
61 # https://wiki.archlinux.org/index.php/systemd#Disable_emergency_mode_on_remote_machine
62 systemd.enableEmergencyMode = false;
64 # This is a remote headless server: always reboot on a kernel panic,
65 # to not have to physically go power cycle the apu2e4.
66 # Which happens if the wrong ZFS password is used
67 # but the boot is manually forced to continue.
68 # Using kernelParams instead of kernel.sysctl
69 # sets this up as soon as the initrd.
70 boot.kernelParams = [ "panic=10" ];
75 passwordAuthentication = false;
87 #checkConfigurationOptions = false;
88 systemPackages = with pkgs; [
108 etc."inputrc".text = lib.readFile defaults/readline/inputrc;
113 interactiveShellInit = ''
114 bind '"\e[A":history-search-backward'
115 bind '"\e[B":history-search-forward'
117 # Ignore duplicate commands, ignore commands starting with a space
118 export HISTCONTROL=erasedups:ignorespace
119 export HISTSIZE=42000
121 # Append to the history instead of overwriting (good for multiple connections)
128 ls = "ls --color=tty";
129 mem = "ps -e -orss=,user=,args= | sort -b -k1,1n";
132 s-u="systemctl --user";
134 nixos-clean="sudo nix-collect-garbage -d";
135 nixos-history="sudo nix-env --list-generations --profile /nix/var/nix/profiles/system";
136 nixos-rollback="sudo nixos-rebuild switch --rollback";
137 nixos-update="sudo nix-channel --update";
138 nixos-upgrade="sudo nixos-rebuild switch";
139 nixos-upstream="sudo nix-channel --list";
144 pinentryFlavor = "curses";