1 { pkgs, lib, config, ... }:
2 let inherit (lib) types;
7 defaults/predictable-interface-names.nix
13 #binaryCaches = lib.mkForce [];
16 # Use gc.automatic to keep disk space under control.
20 options = "--delete-older-than 30d";
23 # WARNING: this is a hack to avoid copying Nixpkgs
24 # a second time into the Nix store.
25 # It makes only sense when Nixpkgs is already in the Nix store,
27 "nixpkgs=${toString pkgs.path}"
35 packageOverrides = pkgs: {
36 postfix = pkgs.postfix.override {
42 overlays = import ./overlays.nix;
45 documentation.nixos = {
46 enable = false; # NOTE: useless on a server, and CPU intensive.
50 timeZone = "Europe/Paris";
54 defaultLocale = "fr_FR.UTF-8";
58 font = "Lat2-Terminus16";
62 # Always try to start all the units (default.target)
63 # because systemd's emergency shell does not try to start sshd.
64 # https://wiki.archlinux.org/index.php/systemd#Disable_emergency_mode_on_remote_machine
65 systemd.enableEmergencyMode = false;
67 # This is a remote headless server: always reboot on a kernel panic,
68 # to not have to physically go power cycle the apu2e4.
69 # Which happens if the wrong ZFS password is used
70 # but the boot is manually forced to continue.
71 # Using kernelParams instead of kernel.sysctl
72 # sets this up as soon as the initrd.
73 boot.kernelParams = [ "panic=10" ];
75 boot.cleanTmpDir = true;
76 boot.tmpOnTmpfs = true;
81 passwordAuthentication = false;
93 #checkConfigurationOptions = false;
94 #etc.nixpkgs.source = (pkgs.runCommandLocal "pkgs.path" {propagatedBuildInputs=[pkgs.path]; buildInputs=[pkgs.path];} "mkdir $out");
95 systemPackages = with pkgs; [
96 pkgs.path # WARNING: this is a hack to register the path to Nixpkgs. See nix.nixPath.
114 linuxPackages.cpupower
117 etc."inputrc".text = lib.readFile defaults/readline/inputrc;
122 interactiveShellInit = ''
123 bind '"\e[A":history-search-backward'
124 bind '"\e[B":history-search-forward'
126 # Ignore duplicate commands, ignore commands starting with a space
127 export HISTCONTROL=erasedups:ignorespace
128 export HISTSIZE=42000
130 # Append to the history instead of overwriting (good for multiple connections)
133 # Enable ** file pattern
136 # Convenient mkdir wrapper
137 mkcd() { mkdir -p "$1" && cd "$1"; }
143 ls = "ls --color=tty";
144 mem = "ps -e -orss=,user=,args= | sort -b -k1,1n";
147 s-u="systemctl --user";
149 nixos-clean="sudo nix-collect-garbage -d";
150 nixos-history="sudo nix-env --list-generations --profile /nix/var/nix/profiles/system";
151 nixos-rollback="sudo nixos-rebuild switch --rollback";
152 nixos-update="sudo nix-channel --update";
153 nixos-upgrade="sudo nixos-rebuild switch";
154 nixos-upstream="sudo nix-channel --list";
159 pinentryFlavor = "curses";