-
Notifications
You must be signed in to change notification settings - Fork 1
/
nix-settings.nix
56 lines (47 loc) · 1.92 KB
/
nix-settings.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
{ inputs, outputs, config, lib, ... }: {
nix = {
# This will add each flake input as a registry
# To make nix3 commands consistent with your flake
registry = lib.mkForce (lib.mapAttrs (_: value: { flake = value; }) inputs);
# This will additionally add your inputs to the system's legacy channels
# Making legacy nix commands consistent as well, awesome!
nixPath = lib.mapAttrsToList (key: value: "${key}=${value.to.path}") config.nix.registry;
settings = {
# Enable flakes and new 'nix' command
experimental-features = "nix-command flakes";
# Deduplicate and optimize nix store
auto-optimise-store = true;
extra-substituters = [
"https://cache.nixos.org"
"https://nix-community.cachix.org"
"https://nixpkgs-wayland.cachix.org"
];
extra-trusted-public-keys = [
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
"nixpkgs-wayland.cachix.org-1:3lwxaILxMRkVhehr5StQprHdEo4IrE8sRho9R9HOLYA="
];
# Enables local builds, but remote targets
# Suppose we run the following on `starlabs`:
# $ nixos-rebuild test --flake .#muro --target-host juuso@192.168.76.40 --use-remote-sudo
# This:
# 1. builds the host muro on our local computer
# 2. transfers the derivations to muro
# 3. activates the updates configuration on muro
# You can change the `test` into `build` to do only 1 and 2.
# To just do the step 1, run:
# $ nix build .#muro
trusted-users = [ "root" "@wheel" ];
};
buildMachines = [ ];
distributedBuilds = true;
# optional, useful when the builder has a faster internet connection than yours
extraOptions = ''
builders-use-substitutes = true
'';
};
nixpkgs.overlays = [
outputs.overlays.default
];
nixpkgs.config.allowUnfree = true;
}