refactor(system): simplify Nix config file
This commit is contained in:
parent
c1b638a61b
commit
786dd6a991
|
@ -19,33 +19,32 @@ in
|
|||
default = "30d";
|
||||
};
|
||||
};
|
||||
config = lib.mkMerge [
|
||||
(lib.mkIf cfg.allowUnfree { nixpkgs.config.allowUnfree = true; })
|
||||
({
|
||||
nix = {
|
||||
# Enable Flakes
|
||||
settings.experimental-features = [
|
||||
"nix-command"
|
||||
"flakes"
|
||||
];
|
||||
config = {
|
||||
nixpkgs.config.allowUnfree = cfg.allowUnfree;
|
||||
|
||||
# Enable periodic nix store optimization
|
||||
optimise.automatic = true;
|
||||
nix = {
|
||||
# Enable Flakes
|
||||
settings.experimental-features = [
|
||||
"nix-command"
|
||||
"flakes"
|
||||
];
|
||||
|
||||
# Enable weekly garbage collection. Delete generations that are older than two weeks.
|
||||
gc = {
|
||||
automatic = true;
|
||||
dates = "weekly";
|
||||
options = "--delete-older-than ${cfg.retentionPeriod}";
|
||||
};
|
||||
# Enable periodic nix store optimization
|
||||
optimise.automatic = true;
|
||||
|
||||
# Configure NixOS to use the same software channel as Flakes
|
||||
registry = lib.mapAttrs (_: value: { flake = value; }) inputs;
|
||||
nixPath = lib.mapAttrsToList (key: value: "${key}=${value.to.path}") config.nix.registry;
|
||||
# Enable weekly garbage collection. Delete generations that are older than two weeks.
|
||||
gc = {
|
||||
automatic = true;
|
||||
dates = "weekly";
|
||||
options = "--delete-older-than ${cfg.retentionPeriod}";
|
||||
};
|
||||
|
||||
# Support for standard, dynamically-linked executables
|
||||
programs.nix-ld.enable = true;
|
||||
})
|
||||
];
|
||||
# Configure NixOS to use the same software channel as Flakes
|
||||
registry = lib.mapAttrs (_: value: { flake = value; }) inputs;
|
||||
nixPath = lib.mapAttrsToList (key: value: "${key}=${value.to.path}") config.nix.registry;
|
||||
};
|
||||
|
||||
# Support for standard, dynamically-linked executables
|
||||
programs.nix-ld.enable = true;
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue