43 lines
808 B
Nix
43 lines
808 B
Nix
{ config, lib, ... }:
|
|
let
|
|
cfg = config.my.utils.commons;
|
|
in
|
|
{
|
|
options.my.utils.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;
|
|
|
|
};
|
|
}
|