From d3b7c472a1346c46935251b8c1509993cab3185a Mon Sep 17 00:00:00 2001 From: Joseph Hanson Date: Thu, 23 May 2024 12:22:57 -0500 Subject: [PATCH] Build caching. --- agents/fj-hetzner-aarch64.nix | 3 +++ agents/fj-shadowfax-x86_64.nix | 3 +++ cachix.nix | 16 ++++++++++++++++ cachix/hsndev.nix | 13 +++++++++++++ cachix/nix-community.nix | 13 +++++++++++++ cachix/numtide.nix | 13 +++++++++++++ 6 files changed, 61 insertions(+) create mode 100644 cachix.nix create mode 100644 cachix/hsndev.nix create mode 100644 cachix/nix-community.nix create mode 100644 cachix/numtide.nix diff --git a/agents/fj-hetzner-aarch64.nix b/agents/fj-hetzner-aarch64.nix index 83905ac..ae3c517 100644 --- a/agents/fj-hetzner-aarch64.nix +++ b/agents/fj-hetzner-aarch64.nix @@ -1,5 +1,8 @@ { pkgs, config, lib, ... }: { + imports = [ + ../cachix.nix + ]; environment.systemPackages = with pkgs; [ # vim -- added by srvos.nixosModules.server # git -- srvos.nixosModules.server diff --git a/agents/fj-shadowfax-x86_64.nix b/agents/fj-shadowfax-x86_64.nix index bd410ee..08d363f 100644 --- a/agents/fj-shadowfax-x86_64.nix +++ b/agents/fj-shadowfax-x86_64.nix @@ -1,5 +1,8 @@ { pkgs, config, lib, ... }: { + imports = [ + ../cachix.nix + ]; environment.systemPackages = with pkgs; [ # vim -- added by srvos.nixosModules.server # git -- srvos.nixosModules.server diff --git a/cachix.nix b/cachix.nix new file mode 100644 index 0000000..850eddd --- /dev/null +++ b/cachix.nix @@ -0,0 +1,16 @@ + +# 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/"]; + builders-use-substitutes = true; + }; +} diff --git a/cachix/hsndev.nix b/cachix/hsndev.nix new file mode 100644 index 0000000..1d59976 --- /dev/null +++ b/cachix/hsndev.nix @@ -0,0 +1,13 @@ + +{ + nix = { + settings = { + substituters = [ + "https://hsndev.cachix.org" + ]; + trusted-public-keys = [ + "hsndev.cachix.org-1:vN1/XGBZtMLnTFYDmTLDrullgZHSUYY3Kqt+Yg/C+tE=" + ]; + }; + }; +} diff --git a/cachix/nix-community.nix b/cachix/nix-community.nix new file mode 100644 index 0000000..7fc4c65 --- /dev/null +++ b/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=" + ]; + }; + }; +} diff --git a/cachix/numtide.nix b/cachix/numtide.nix new file mode 100644 index 0000000..309a03b --- /dev/null +++ b/cachix/numtide.nix @@ -0,0 +1,13 @@ + +{ + nix = { + settings = { + substituters = [ + "https://numtide.cachix.org" + ]; + trusted-public-keys = [ + "numtide.cachix.org-1:2ps1kLBUWjxIneOy1Ik6cQjb41X0iXVXeHigGmycPPE=" + ]; + }; + }; +}