infra/modules/shared/nix-daemon.nix

29 lines
743 B
Nix
Raw Normal View History

{ pkgs, ... }:
2021-03-04 10:56:14 +01:00
let
2023-09-05 17:27:20 +10:00
asGB = size: toString (size * 1024 * 1024 * 1024);
2021-03-04 10:56:14 +01:00
in
{
nix = {
settings.trusted-public-keys = [
2021-03-04 10:56:14 +01:00
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
];
2024-07-24 19:05:26 +10:00
settings.substituters = [ "https://nix-community.cachix.org" ];
2021-03-04 10:56:14 +01:00
# Hard-link duplicated files
2024-07-11 17:55:20 +10:00
settings.auto-optimise-store = pkgs.lib.mkDefault true;
2021-03-06 19:15:05 +01:00
# auto-free the /nix/store
settings.min-free = asGB 10;
settings.max-free = asGB 50;
2021-03-04 10:56:14 +01:00
# useful for ad-hoc nix-shell's for debugging
2023-07-29 17:37:07 +10:00
# use mkForce to avoid search path warnings with nix-darwin
nixPath = pkgs.lib.mkForce [ "nixpkgs=${pkgs.path}" ];
2021-03-04 10:56:14 +01:00
gc.automatic = true;
2023-09-07 12:47:33 +10:00
gc.options = pkgs.lib.mkDefault "--delete-older-than 14d";
2021-03-04 10:56:14 +01:00
};
}