voidconf/modules/nix-settings.nix

48 lines
1 KiB
Nix
Raw Normal View History

2023-12-16 19:26:15 +01:00
{ lib, config, ... }:
with lib;
2025-04-18 09:37:57 +02:00
let
cfg = config.voidconf.nixSettings;
in
{
2024-02-17 18:49:37 +01:00
options.voidconf.nixSettings = {
2023-12-16 19:26:15 +01:00
gc = {
automatic = mkOption {
type = types.bool;
default = true;
description = "Enables automatic garbage collection";
};
dates = mkOption {
type = types.str;
default = "weekly";
example = "03:15";
description = mdDoc ''
How often or when garbage collection is performed. For most desktop and server systems
a sufficient garbage collection is once a week.
The format is described in
{manpage}`systemd.time(7)`.
'';
};
};
};
config = {
nix = {
2023-12-23 01:09:38 +01:00
optimise.automatic = true;
2023-12-16 19:26:15 +01:00
settings = {
trusted-users = [
"root"
"@wheel"
];
};
gc = {
automatic = cfg.gc.automatic;
dates = cfg.gc.dates;
};
2025-04-18 09:37:57 +02:00
settings.experimental-features = [
"flakes"
"nix-command"
];
2023-12-16 19:26:15 +01:00
};
};
}