1 { config, pkgs, lib, inputs, ... }:
4 boot.tmp.cleanOnBoot = mkDefault true;
5 boot.tmp.useTmpfs = mkDefault true;
6 services.logrotate.enable = true;
7 # NOTE: mostly useless on a server, and CPU intensive.
9 enable = mkDefault true;
10 dev.enable = mkDefault false;
11 doc.enable = mkDefault true;
12 info.enable = mkDefault false;
13 man.enable = mkDefault true;
14 nixos.enable = mkDefault false;
16 programs.vim.defaultEditor = mkDefault true;
17 environment.variables = {
19 NIXPKGS_CONFIG = mkForce "";
21 SYSTEMD_LESS = "FKMRX";
22 # Setting TZ= avoids a lot of useless syscalls reading /etc/localtime
23 # but requires to restart the session to change the time zone for all programs.
24 TZ = config.time.timeZone;
26 home-manager.users.root = {
28 ../../home-manager/options.nix
29 ../../home-manager/profiles/essential.nix
32 systemd.services.home-manager-root.postStart = ''
33 ${pkgs.nix}/bin/nix-env --delete-generations +1 --profile /nix/var/nix/profiles/per-user/root/home-manager
36 settings.auto-optimise-store = mkDefault true;
37 gc.automatic = mkDefault true;
38 gc.dates = mkDefault "weekly";
39 gc.options = mkDefault "--delete-older-than 7d";
40 nixPath = mkForce [ ];
41 registry.nixpkgs = mkDefault { flake = inputs.nixpkgs; };
42 package = pkgs.nixFlakes;
43 settings.experimental-features = [ "nix-command" "flakes" ];
45 security.lockKernelModules = false;
49 MaxRetentionSec=1month
55 enable = mkDefault true;
56 enableRootSlice = mkDefault true;
57 enableSystemSlice = mkDefault true;
58 enableUserServices = mkDefault true;
60 systemd.services.openssh = {
62 ManagedOOMPreference = "omit";
66 system.nixos.versionSuffix = ".${
67 substring 0 8 (inputs.self.lastModifiedDate or inputs.self.lastModified)}.${
68 inputs.self.shortRev or "dirty"}";
69 system.nixos.revision = mkIf (inputs.self ? rev) inputs.self.rev;
71 # Let 'nixos-version --json' know about the Git revision of this flake.
72 system.configurationRevision = mkIf (inputs.self ? rev) inputs.self.rev;
74 system.configurationRevision =
77 else throw "Refusing to build from a dirty Git tree!";
79 users.mutableUsers = false;