50 lines
1.1 KiB
Nix
Raw Normal View History

2025-05-04 02:47:36 +02:00
{
lib,
config,
...
}:
with lib; let
2025-07-05 00:02:39 +02:00
cfg = config.system.packages.nix;
2025-05-04 02:47:36 +02:00
in {
2025-07-05 00:02:39 +02:00
options.system.packages.nix = {
allowUnfree = mkEnableOption "Enable unfree packages";
disableSandbox = mkEnableOption "Disable Nix sandbox";
2025-05-04 02:47:36 +02:00
gc = {
automatic = mkOption {
type = types.bool;
default = true;
};
dates = mkOption {
type = types.str;
default = "Monday 01:00 UTC";
};
options = mkOption {
type = types.str;
default = "--delete-older-than 30d";
};
};
2025-07-05 00:02:39 +02:00
nix-ld.enable = mkEnableOption "Enable unpatched binaries support";
trusted-users = mkOption {
type = types.listOf types.str;
example = ["alice" "bob"];
default = [];
};
2025-05-04 02:47:36 +02:00
};
config = {
nix = {
2025-07-05 00:02:39 +02:00
inherit (cfg) gc;
2025-05-04 02:47:36 +02:00
settings = {
2025-07-05 00:02:39 +02:00
inherit (cfg) trusted-users;
2025-05-04 02:47:36 +02:00
sandbox = cfg.disableSandbox;
experimental-features = ["nix-command" "flakes"];
auto-optimise-store = true;
};
};
nixpkgs.config.allowUnfree = true;
2025-07-05 00:02:39 +02:00
programs = {
inherit (cfg) nix-ld;
};
2025-05-04 02:47:36 +02:00
};
}