Configure cachix automatically on NixOS

This commit is contained in:
Quentin Boyer 2023-02-12 15:25:18 +01:00
parent e681812b52
commit 6e991643d3
3 changed files with 27 additions and 0 deletions

13
nixos/cachix.nix Normal file
View file

@ -0,0 +1,13 @@
# WARN: this file will get overwritten by $ cachix use <name>
{ pkgs, lib, ... }:
let
folder = ./cachix;
toImport = name: value: folder + ("/" + name);
filterCaches = key: value: value == "regular" && lib.hasSuffix ".nix" key;
imports = lib.mapAttrsToList toImport (lib.filterAttrs filterCaches (builtins.readDir folder));
in {
inherit imports;
nix.settings.substituters = ["https://cache.nixos.org/"];
}

13
nixos/cachix/traxys.nix Normal file
View file

@ -0,0 +1,13 @@
{
nix = {
settings = {
substituters = [
"https://traxys.cachix.org"
];
trusted-public-keys = [
"traxys.cachix.org-1:8Qir8lQJdhzUaw5AE7ICom/IB25wgdheZFxdMln7Qgg="
];
};
};
}

View file

@ -12,6 +12,7 @@
./pkg.nix
#./home.nix
./localcfg.nix
./cachix.nix
];
# The global useDHCP flag is deprecated, therefore explicitly set to false here.