From 6e991643d35f40afaa4abc4dc12b264920376eb6 Mon Sep 17 00:00:00 2001 From: Quentin Boyer Date: Sun, 12 Feb 2023 15:25:18 +0100 Subject: [PATCH] Configure cachix automatically on NixOS --- nixos/cachix.nix | 13 +++++++++++++ nixos/cachix/traxys.nix | 13 +++++++++++++ nixos/configuration.nix | 1 + 3 files changed, 27 insertions(+) create mode 100644 nixos/cachix.nix create mode 100644 nixos/cachix/traxys.nix diff --git a/nixos/cachix.nix b/nixos/cachix.nix new file mode 100644 index 0000000..ecd2d39 --- /dev/null +++ b/nixos/cachix.nix @@ -0,0 +1,13 @@ + +# WARN: this file will get overwritten by $ cachix use +{ 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/"]; +} diff --git a/nixos/cachix/traxys.nix b/nixos/cachix/traxys.nix new file mode 100644 index 0000000..18d8eb3 --- /dev/null +++ b/nixos/cachix/traxys.nix @@ -0,0 +1,13 @@ + +{ + nix = { + settings = { + substituters = [ + "https://traxys.cachix.org" + ]; + trusted-public-keys = [ + "traxys.cachix.org-1:8Qir8lQJdhzUaw5AE7ICom/IB25wgdheZFxdMln7Qgg=" + ]; + }; + }; +} diff --git a/nixos/configuration.nix b/nixos/configuration.nix index 9a57f1b..d835a9d 100644 --- a/nixos/configuration.nix +++ b/nixos/configuration.nix @@ -12,6 +12,7 @@ ./pkg.nix #./home.nix ./localcfg.nix + ./cachix.nix ]; # The global useDHCP flag is deprecated, therefore explicitly set to false here.