Moved modules into appropriate folders

This commit is contained in:
pazpi 2024-08-27 11:09:20 +02:00
parent 48dcf38304
commit 3760c929fe
9 changed files with 18 additions and 8 deletions

43
modules/utils/commons.nix Normal file
View file

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

View file

@ -0,0 +1,5 @@
{
imports = [
./commons.nix
];
}