-
Notifications
You must be signed in to change notification settings - Fork 0
/
nix.nix
80 lines (79 loc) · 1.86 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
69
70
71
72
73
74
75
76
77
78
79
80
{
config,
pkgs,
inputs,
...
}:
let
nixSettings = {
connect-timeout = 60;
download-attempts = 10;
cores = 4;
experimental-features = [
"nix-command"
"flakes"
];
fallback = true;
keep-outputs = true;
keep-going = true;
log-lines = 25;
max-jobs = 3;
};
in
{
services.nix-daemon.enable = true;
nix = {
package = pkgs.nixVersions.stable;
extraOptions = ''
keep-outputs = true
keep-derivations = true
'';
optimise.automatic = true;
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"
"https://cache.lix.systems"
];
trusted-public-keys = [
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
"cache.lix.systems:aBnZUw8zA7H35Cz2RyKFVs3H4PlGTLawyY5KRbvJR8o="
];
};
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.package = pkgs.lix;
nix.settings = nixSettings // {
sandbox = false;
};
environment.systemPackages = [ pkgs.htop ];
}
);
};
};
nixpkgs = {
hostPlatform = "x86_64-darwin";
config.allowUnfree = true;
};
}