From 37a30777428c2d4b3764b5a07c7f765f6e0e02c8 Mon Sep 17 00:00:00 2001 From: Chris Cochrun Date: Sun, 6 Aug 2023 06:25:56 -0500 Subject: [PATCH] adding cachix --- modules/base.nix | 1 + modules/cachix.nix | 13 +++++++++++++ modules/cachix/nix-community.nix | 13 +++++++++++++ 3 files changed, 27 insertions(+) create mode 100644 modules/cachix.nix create mode 100644 modules/cachix/nix-community.nix diff --git a/modules/base.nix b/modules/base.nix index 6c7b58f..706f5e3 100644 --- a/modules/base.nix +++ b/modules/base.nix @@ -2,6 +2,7 @@ with lib; { + imports = [ ./cachix.nix ]; nix = { extraOptions = "experimental-features = nix-command flakes"; diff --git a/modules/cachix.nix b/modules/cachix.nix new file mode 100644 index 0000000..ecd2d39 --- /dev/null +++ b/modules/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/modules/cachix/nix-community.nix b/modules/cachix/nix-community.nix new file mode 100644 index 0000000..7fc4c65 --- /dev/null +++ b/modules/cachix/nix-community.nix @@ -0,0 +1,13 @@ + +{ + nix = { + settings = { + substituters = [ + "https://nix-community.cachix.org" + ]; + trusted-public-keys = [ + "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" + ]; + }; + }; +}