55 lines
1.7 KiB
Nix
Executable File
55 lines
1.7 KiB
Nix
Executable File
# Shared nix daemon / nixpkgs settings used by both the NixOS and nix-darwin
|
|
# modules (modules/nixos/nix/default.nix and modules/darwin/nix/default.nix).
|
|
#
|
|
# Snowfall Lib discovers this file and merges its return value into
|
|
# lib.<namespace>.* — the nested attrset is accessed as:
|
|
# lib.${namespace}.nixSettings.commonSubstituters
|
|
# lib.${namespace}.nixSettings.commonTrustedPublicKeys
|
|
# lib.${namespace}.nixSettings.commonSettings
|
|
# lib.${namespace}.nixSettings.commonGc
|
|
{ lib, ... }:
|
|
let
|
|
net = lib.mjallen.network;
|
|
in
|
|
{
|
|
nixSettings = {
|
|
commonSubstituters = [
|
|
"http://${net.hosts.nas.lan}:${toString net.ports.nas.attic}/nas-cache"
|
|
"https://nixos-apple-silicon.cachix.org"
|
|
"https://nixos-raspberrypi.cachix.org"
|
|
"https://nix-community.cachix.org"
|
|
"https://cache.nixos.org/"
|
|
];
|
|
|
|
commonTrustedPublicKeys = [
|
|
"nas-cache:eK0eRVAt9QNwbkLIyOo9N5Z5+zi6ukI4mSlL196C7Yg="
|
|
"nixos-apple-silicon.cachix.org-1:8psDu5SA5dAD7qA0zMy5UT292TxeEPzIz8VVEr2Js20="
|
|
"nixos-raspberrypi.cachix.org-1:4iMO9LXa8BqhU+Rpg6LQKiGa2lsNh/j2oiYLNOQ5sPI="
|
|
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
|
|
];
|
|
|
|
commonSettings = {
|
|
warn-dirty = lib.mkForce false;
|
|
experimental-features = lib.mkForce [
|
|
"nix-command"
|
|
"flakes"
|
|
];
|
|
trusted-users = [
|
|
"@wheel"
|
|
"@admin"
|
|
];
|
|
builders-use-substitutes = true;
|
|
connect-timeout = lib.mkDefault 5;
|
|
fallback = true;
|
|
log-lines = lib.mkDefault 25;
|
|
max-free = lib.mkDefault (3000 * 1024 * 1024);
|
|
min-free = lib.mkDefault (512 * 1024 * 1024);
|
|
};
|
|
|
|
commonGc = {
|
|
automatic = lib.mkDefault true;
|
|
options = lib.mkDefault "--delete-older-than 30d";
|
|
};
|
|
};
|
|
}
|