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=" + ]; + }; + }; +}