-
Notifications
You must be signed in to change notification settings - Fork 0
/
nix.nix
68 lines (67 loc) · 1.72 KB
/
nix.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
{ config, pkgs, inputs, ... }:
let
nixSettings = {
auto-optimise-store = true;
connect-timeout = 60;
download-attempts = 10;
cores = 4;
experimental-features = [ "nix-command" "flakes" "repl-flake" ];
fallback = true;
keep-outputs = true;
keep-going = true;
log-lines = 25;
max-jobs = 3;
};
in {
services.nix-daemon.enable = true;
nix = {
package = pkgs.nixFlakes;
extraOptions = ''
keep-outputs = true
keep-derivations = true
'';
gc = {
automatic = true;
interval = {
Hour = 18;
Minute = 15;
};
options = "-d --delete-older-than 7d";
};
settings = nixSettings // {
max-free = 1000000000;
min-free = 128000000;
warn-dirty = false;
trusted-users = [ "@admin" ];
trusted-substituters =
[ "https://cache.nixos.org" "https://nix-community.cachix.org" ];
trusted-public-keys = [
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
];
};
distributedBuilds = true;
linux-builder = {
enable = true;
maxJobs = 3;
config = ({ pkgs, ... }: {
users.extraGroups.docker.members =
builtins.map (i: "nixbld" + builtins.toString i)
(pkgs.lib.genList (i: i + 1) 32);
virtualisation = {
docker.enable = true;
darwin-builder = {
diskSize = 50 * 1024;
memorySize = 8 * 1024;
};
cores = 8;
};
nix.settings = nixSettings // { sandbox = false; };
});
};
};
nixpkgs = {
hostPlatform = "x86_64-darwin";
config.allowUnfree = true;
};
}