nix/modules/commons.nix
2024-08-16 18:22:21 +02:00

40 lines
768 B
Nix

{ config, lib, ... }:
let
cfg = config.commons;
in
{
options.commons = {
enable = lib.mkEnableOption "Enable commons stuff that are always nice to have";
allowReboot = lib.mkOption {
default = false;
type = lib.types.bool;
description = config.system.autoUpgrade.allowReboot;
};
};
config = lib.mkIf cfg.enable {
# Auto update
system.autoUpgrade = {
enable = true;
randomizedDelaySec = "10min";
allowReboot = cfg.allowReboot;
};
nix = {
settings.experimental-features = [ "nix-command" "flakes" ];
gc = {
# Auto delete old generations
automatic = true;
options = "--delete-older-than 2d";
};
};
nixpkgs.config.allowUnfree = true;
};
}