feat: NixOS template for new users #33
|
@ -19,33 +19,32 @@ in
|
||||||
default = "30d";
|
default = "30d";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
config = lib.mkMerge [
|
config = {
|
||||||
(lib.mkIf cfg.allowUnfree { nixpkgs.config.allowUnfree = true; })
|
nixpkgs.config.allowUnfree = cfg.allowUnfree;
|
||||||
({
|
|
||||||
nix = {
|
|
||||||
# Enable Flakes
|
|
||||||
settings.experimental-features = [
|
|
||||||
"nix-command"
|
|
||||||
"flakes"
|
|
||||||
];
|
|
||||||
|
|
||||||
# Enable periodic nix store optimization
|
nix = {
|
||||||
optimise.automatic = true;
|
# Enable Flakes
|
||||||
|
settings.experimental-features = [
|
||||||
|
"nix-command"
|
||||||
|
"flakes"
|
||||||
|
];
|
||||||
|
|
||||||
# Enable weekly garbage collection. Delete generations that are older than two weeks.
|
# Enable periodic nix store optimization
|
||||||
gc = {
|
optimise.automatic = true;
|
||||||
automatic = true;
|
|
||||||
dates = "weekly";
|
|
||||||
options = "--delete-older-than ${cfg.retentionPeriod}";
|
|
||||||
};
|
|
||||||
|
|
||||||
# Configure NixOS to use the same software channel as Flakes
|
# Enable weekly garbage collection. Delete generations that are older than two weeks.
|
||||||
registry = lib.mapAttrs (_: value: { flake = value; }) inputs;
|
gc = {
|
||||||
nixPath = lib.mapAttrsToList (key: value: "${key}=${value.to.path}") config.nix.registry;
|
automatic = true;
|
||||||
|
dates = "weekly";
|
||||||
|
options = "--delete-older-than ${cfg.retentionPeriod}";
|
||||||
};
|
};
|
||||||
|
|
||||||
# Support for standard, dynamically-linked executables
|
# Configure NixOS to use the same software channel as Flakes
|
||||||
programs.nix-ld.enable = true;
|
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