nix/modules/commons.nix
2024-08-27 09:46:44 +02:00

43 lines
790 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;
};
}