infra/roles/nix-daemon.nix

41 lines
948 B
Nix
Raw Normal View History

2021-03-04 10:56:14 +01:00
{ config, lib, pkgs, ... }:
let
asGB = size: toString (size * 1024 * 1024);
in
{
nix = {
settings.trusted-public-keys = [
2021-03-04 10:56:14 +01:00
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
];
settings.substituters = [
2021-03-04 10:56:14 +01:00
"https://nix-community.cachix.org"
];
# Hard-link duplicated files
settings.auto-optimise-store = true;
2021-03-06 19:15:05 +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
# avoid copying unecessary stuff over SSH
settings.builders-use-substitutes = true;
2021-03-04 10:56:14 +01:00
# allow flakes
settings.experimental-features = "nix-command flakes";
2021-03-04 10:56:14 +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;
gc.options = "--delete-older-than 30d";
};
users.groups.trusted = {};
2021-03-04 10:56:14 +01:00
}