-{ config, pkgs, lib, ... }:
+{ pkgs, lib, inputs, ... }:
+with lib;
{
-imports = [
- ./bash.nix
- ./nixos-fallback.nix
-];
-documentation = {
- enable = lib.mkDefault true;
- dev.enable = lib.mkDefault false;
- doc.enable = lib.mkDefault true;
- info.enable = lib.mkDefault false;
- man.enable = lib.mkDefault true;
- nixos.enable = lib.mkDefault false;
-};
-environment.variables = {
- EDITOR = "vim";
- PAGER = "less -R";
- SYSTEMD_LESS = "FKMRX";
-};
-home-manager.users.root = {
- imports = [
- ../../home-manager/options.nix
- ../../home-manager/profiles/essential.nix
- ];
-};
-systemd.services.home-manager-root.postStart = ''
- ${pkgs.nix}/bin/nix-env --delete-generations +1 --profile /nix/var/nix/profiles/per-user/root/home-manager
-'';
-nix = {
- settings.auto-optimise-store = lib.mkDefault true;
- gc.automatic = lib.mkDefault true;
- gc.dates = lib.mkDefault "weekly";
- gc.options = lib.mkDefault "--delete-older-than 7d";
- nixPath = lib.mkForce [ ];
-};
-security.lockKernelModules = false;
-services.journald = {
- extraConfig = ''
- Compress=true
- MaxRetentionSec=1month
- Storage=persistent
- SystemMaxUse=100M
+ boot.cleanTmpDir = mkDefault true;
+ boot.tmpOnTmpfs = mkDefault true;
+ services.logrotate.enable = true;
+ # NOTE: mostly useless on a server, and CPU intensive.
+ documentation = {
+ enable = mkDefault true;
+ dev.enable = mkDefault false;
+ doc.enable = mkDefault true;
+ info.enable = mkDefault false;
+ man.enable = mkDefault true;
+ nixos.enable = mkDefault false;
+ };
+ environment.variables = {
+ EDITOR = "vim";
+ PAGER = "less -R";
+ SYSTEMD_LESS = "FKMRX";
+ NIXPKGS_CONFIG = mkForce "";
+ };
+ home-manager.users.root = {
+ imports = [
+ ../../home-manager/options.nix
+ ../../home-manager/profiles/essential.nix
+ ];
+ };
+ systemd.services.home-manager-root.postStart = ''
+ ${pkgs.nix}/bin/nix-env --delete-generations +1 --profile /nix/var/nix/profiles/per-user/root/home-manager
'';
-};
-users.mutableUsers = false;
+ nix = {
+ settings.auto-optimise-store = mkDefault true;
+ gc.automatic = mkDefault true;
+ gc.dates = mkDefault "weekly";
+ gc.options = mkDefault "--delete-older-than 7d";
+ nixPath = mkForce [ ];
+ registry.nixpkgs = mkDefault { flake = inputs.nixpkgs; };
+ package = pkgs.nixFlakes;
+ extraOptions = "experimental-features = nix-command flakes";
+ };
+ security.lockKernelModules = false;
+ services.journald = {
+ extraConfig = ''
+ Compress=true
+ MaxRetentionSec=1month
+ Storage=persistent
+ SystemMaxUse=100M
+ '';
+ };
+ /*
+ system.nixos.versionSuffix = ".${
+ substring 0 8 (inputs.self.lastModifiedDate or inputs.self.lastModified)}.${
+ inputs.self.shortRev or "dirty"}";
+ system.nixos.revision = mkIf (inputs.self ? rev) inputs.self.rev;
+ */
+ # Let 'nixos-version --json' know about the Git revision of this flake.
+ system.configurationRevision = mkIf (inputs.self ? rev) inputs.self.rev;
+ /*
+ system.configurationRevision =
+ if inputs.self ? rev
+ then inputs.self.rev
+ else throw "Refusing to build from a dirty Git tree!";
+ */
+ users.mutableUsers = false;
}