From 3bb8db1349ede568674e03cbc78b9ea5a1267ea3 Mon Sep 17 00:00:00 2001 From: Julian Mutter Date: Fri, 4 Jul 2025 14:40:58 +0200 Subject: [PATCH] Fix builder using itself as remote subsituter --- hosts/aspi/default.nix | 1 + hosts/builder/default.nix | 6 +++++- hosts/common/global/nix.nix | 20 -------------------- hosts/common/optional/binarycaches.nix | 25 +++++++++++++++++++++++++ hosts/kardorf/default.nix | 1 + hosts/pianonix/default.nix | 1 + 6 files changed, 33 insertions(+), 21 deletions(-) create mode 100644 hosts/common/optional/binarycaches.nix diff --git a/hosts/aspi/default.nix b/hosts/aspi/default.nix index 7ef4d16..1cd2c19 100644 --- a/hosts/aspi/default.nix +++ b/hosts/aspi/default.nix @@ -4,6 +4,7 @@ ../common/global ../common/users/julian + ../common/optional/binarycaches.nix ../common/optional/remote-builder.nix ../common/optional/boot-efi.nix diff --git a/hosts/builder/default.nix b/hosts/builder/default.nix index 96c0287..2be09c8 100644 --- a/hosts/builder/default.nix +++ b/hosts/builder/default.nix @@ -30,8 +30,12 @@ substituters = [ "https://nix-community.cachix.org" "https://cache.nixos.org/" + "https://hyprland.cachix.org" + ]; + trusted-public-keys = [ + "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" + "hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc=" ]; - trusted-public-keys = ["nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="]; trusted-users = ["nix"]; max-jobs = "auto"; diff --git a/hosts/common/global/nix.nix b/hosts/common/global/nix.nix index 55077ec..062f4a8 100644 --- a/hosts/common/global/nix.nix +++ b/hosts/common/global/nix.nix @@ -26,26 +26,6 @@ ]; # warn-dirty = false; - # Setup binary caches - nix.settings = { - substituters = [ - "https://nix-community.cachix.org" - "https://cache.nixos.org/" - "https://hyprland.cachix.org" - "http://binarycache.julian-mutter.de" - ]; - trusted-public-keys = [ - "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" - "hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc=" - "binarycache.julian-mutter.de:oJ67uRFwRhNPKL58CHzy3QQLv38Kx7OA1K+6xlEPu7E=" - ]; - - trusted-users = [ - "root" - "@wheel" - ]; # needed for devenv to add custom caches - }; - nix.gc = { automatic = true; dates = "weekly"; diff --git a/hosts/common/optional/binarycaches.nix b/hosts/common/optional/binarycaches.nix new file mode 100644 index 0000000..f0899dd --- /dev/null +++ b/hosts/common/optional/binarycaches.nix @@ -0,0 +1,25 @@ +{ + lib, + outputs, + ... +}: { + # Setup binary caches + nix.settings = { + substituters = [ + "https://nix-community.cachix.org" + "https://cache.nixos.org/" + "https://hyprland.cachix.org" + "http://binarycache.julian-mutter.de" + ]; + trusted-public-keys = [ + "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" + "hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc=" + "binarycache.julian-mutter.de:oJ67uRFwRhNPKL58CHzy3QQLv38Kx7OA1K+6xlEPu7E=" + ]; + + trusted-users = [ + "root" + "@wheel" + ]; # needed for devenv to add custom caches + }; +} diff --git a/hosts/kardorf/default.nix b/hosts/kardorf/default.nix index 8133bfb..ef330fa 100644 --- a/hosts/kardorf/default.nix +++ b/hosts/kardorf/default.nix @@ -5,6 +5,7 @@ ../common/global ../common/users/julian ../common/users/wolfi + ../common/optional/binarycaches.nix ../common/optional/xserver.nix ../common/optional/remote-builder.nix diff --git a/hosts/pianonix/default.nix b/hosts/pianonix/default.nix index b650cea..22e470c 100644 --- a/hosts/pianonix/default.nix +++ b/hosts/pianonix/default.nix @@ -15,6 +15,7 @@ ../common/global ../common/users/julian + ../common/optional/binarycaches.nix ../common/optional/pipewire.nix ../common/optional/remote-builder.nix