-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathnix-core.nix
41 lines (37 loc) · 1.26 KB
/
nix-core.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
{ pkgs, ... }: {
# enable flakes globally
nix.settings.experimental-features = [ "nix-command" "flakes" ];
# auto upgrade nix package and the daemon service.
services.nix-daemon.enable = true;
nix.package = pkgs.nix;
programs.nix-index.enable = true;
# clean up every once in a while
nix.gc.automatic = true;
# gets rid of duplicate store files
# turned off due to
# https://github.com/NixOS/nix/issues/7273#issuecomment-1325073957
nix.settings.auto-optimise-store = false;
# nix store optimise (manually instead)
# linux builder
# https://nixcademy.com/2024/02/12/macos-linux-builder/
# root was here previously, @admin is for linux-builder
nix.settings.trusted-users = [ "root" "@admin" ];
# sudo launchctl list org.nixos.linux-builder
# sudo launchctl stop org.nixos.linux-builder
nix.linux-builder = {
enable = true;
ephemeral = true;
maxJobs = 4;
config = {
virtualisation = {
darwin-builder = {
diskSize = 40 * 1024; # 40gb
memorySize = 8 * 1024; # 8gb
};
cores = 6;
};
};
};
# try it
# nix build --impure --expr '(with import <nixpkgs> { system = "aarch64-linux"; }; runCommand "foo" { nativeBuildInputs = [ neofetch ]; } "neofetch >> $out" )' && cat result
}