about summary refs log tree commit diff
path: root/users/wpcarro/nixos/modules/hadrian-cache.nix
diff options
context:
space:
mode:
Diffstat (limited to 'users/wpcarro/nixos/modules/hadrian-cache.nix')
-rw-r--r--users/wpcarro/nixos/modules/hadrian-cache.nix17
1 files changed, 17 insertions, 0 deletions
diff --git a/users/wpcarro/nixos/modules/hadrian-cache.nix b/users/wpcarro/nixos/modules/hadrian-cache.nix
new file mode 100644
index 000000000000..033c03c825b7
--- /dev/null
+++ b/users/wpcarro/nixos/modules/hadrian-cache.nix
@@ -0,0 +1,17 @@
+# If enabled, use Hadrian's Nix cache.
+{ config, lib, pkgs, ... }:
+
+{
+  options = {
+    hadrian.cache.enable = lib.mkEnableOption "Hadrian's binary cache";
+  };
+
+  config = lib.mkIf config.hadrian.cache.enable {
+    nix.settings.trusted-public-keys = [
+      "cache.hadrian.internal:XWdYSn5ZASj6IqZd4nnDBXJmahQEolBrtq9DvSe0UT0="
+    ];
+    nix.settings.substituters = [
+      "http://cache.hadrian.internal"
+    ];
+  };
+}