New modules for container managment

This commit is contained in:
pazpi 2024-08-16 18:22:21 +02:00
parent 0a48b3d817
commit 93e9d585cb
No known key found for this signature in database
GPG key ID: 0942571C4B9966BE
7 changed files with 121 additions and 2 deletions

40
modules/commons.nix Normal file
View file

@ -0,0 +1,40 @@
{ 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;
};
}