2023-01-02 09:44:59 +01:00
|
|
|
{ pkgs, ... }:
|
2021-03-04 10:56:14 +01:00
|
|
|
|
|
|
|
let
|
|
|
|
asGB = size: toString (size * 1024 * 1024);
|
|
|
|
in
|
|
|
|
{
|
|
|
|
nix = {
|
2022-01-29 11:24:20 +01:00
|
|
|
settings.trusted-public-keys = [
|
2021-03-04 10:56:14 +01:00
|
|
|
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
|
|
|
|
];
|
|
|
|
|
2022-01-29 11:24:20 +01:00
|
|
|
settings.substituters = [
|
2021-03-04 10:56:14 +01:00
|
|
|
"https://nix-community.cachix.org"
|
|
|
|
];
|
|
|
|
|
2022-01-29 11:24:20 +01:00
|
|
|
# Hard-link duplicated files
|
|
|
|
settings.auto-optimise-store = true;
|
2021-03-06 19:15:05 +01:00
|
|
|
|
2022-01-29 11:24:20 +01:00
|
|
|
# auto-free the /nix/store
|
|
|
|
settings.min-free = asGB 10;
|
|
|
|
settings.max-free = asGB 200;
|
2021-03-04 10:56:14 +01:00
|
|
|
|
2022-01-29 11:24:20 +01:00
|
|
|
# users in trusted group are trusted by the nix-daemon
|
|
|
|
settings.trusted-users = [ "@trusted" ];
|
|
|
|
|
|
|
|
# useful for ad-hoc nix-shell's for debugging
|
|
|
|
nixPath = [ "nixpkgs=${pkgs.path}" ];
|
2021-03-04 10:56:14 +01:00
|
|
|
|
|
|
|
gc.automatic = true;
|
2022-07-11 09:26:03 +02:00
|
|
|
gc.options = "--delete-older-than 14d";
|
2021-03-04 10:56:14 +01:00
|
|
|
};
|
2022-01-29 11:24:20 +01:00
|
|
|
|
2022-02-04 09:28:17 +01:00
|
|
|
# Sometimes it fails if a store path is still in use.
|
|
|
|
# This should fix intermediate issues.
|
|
|
|
systemd.services.nix-gc.serviceConfig = {
|
|
|
|
Restart = "on-failure";
|
|
|
|
};
|
|
|
|
|
2022-08-14 16:49:30 +02:00
|
|
|
users.groups.trusted = { };
|
2021-03-04 10:56:14 +01:00
|
|
|
}
|