nix-files/modules/nix.nix
colin fd48880a0a nixcache: only enable on moby
it's annoying to rebuild on desko/lappy, and have that fail when servo
is offline/unreachable.
and it's really silly to have servo use its own cache *over the
network*.

long-term would be better to do properly distributed builds instead of
the cache.
2022-06-28 03:44:10 -07:00

35 lines
758 B
Nix

{ lib, config, ... }:
with lib;
let
cfg = config.colinsane.nixcache;
in
{
options = {
colinsane.nixcache.enable = mkOption {
default = false;
type = types.bool;
};
};
config = {
# use our own binary cache
nix.settings = mkIf cfg.enable {
substituters = [
"https://nixcache.uninsane.org"
"https://nix-community.cachix.org"
"https://cache.nixos.org/"
];
trusted-public-keys = [
"nixcache.uninsane.org:r3WILM6+QrkmsLgqVQcEdibFD7Q/4gyzD9dGT33GP70="
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
];
};
# allow `nix flake ...` command
nix.extraOptions = ''
experimental-features = nix-command flakes
'';
};
}