From 4dc4040ed819d7532209ce63fe6d2d32c5d5edca Mon Sep 17 00:00:00 2001 From: Yureka Date: Wed, 24 Jul 2024 10:25:26 +0200 Subject: [PATCH] adapt to new version of binary cache module --- binary-cache/tvix-cache.nix | 33 ++++++++++++++++++++------------- npins/sources.json | 4 ++-- 2 files changed, 22 insertions(+), 15 deletions(-) diff --git a/binary-cache/tvix-cache.nix b/binary-cache/tvix-cache.nix index c76e20b..c479f33 100644 --- a/binary-cache/tvix-cache.nix +++ b/binary-cache/tvix-cache.nix @@ -14,6 +14,7 @@ clientMaxBodySize = "50G"; host = "binary-cache"; }; + castoreDir = "/nvme"; caches = { forkos = { grpcListenAddress = "[::1]:5000"; @@ -24,11 +25,16 @@ is_temporary = false; path = "/var/lib/tvix-daemon-forkos/pathinfos.sled"; }; - default = lib.mkForce { + nix = { type = "nix"; - url = "nix+https://bagel-cache.s3-web.delroth.net"; - blobservice = "default"; - directoryservice = "objectstore"; + base_url = "https://bagel-cache.s3-web.delroth.net"; + blob_service = "default"; + directory_service = "objectstore"; + }; + default = lib.mkForce { + type = "cache"; + near = "sled"; + far = "nix"; }; }; }; @@ -41,22 +47,22 @@ is_temporary = false; path = "/var/lib/tvix-daemon-cno/pathinfos.sled"; }; - default = lib.mkForce { + nix = { type = "nix"; - url = "nix+https://cache.nixos.org?trusted-public-keys=cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="; - blobservice = "default"; - directoryservice = "objectstore"; + base_url = "https://cache.nixos.org?trusted-public-keys=cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="; + blob_service = "default"; + directory_service = "objectstore"; + }; + default = lib.mkForce { + type = "cache"; + near = "sled"; + far = "nix"; }; }; }; }; }; - fileSystems."/var/lib/tvix-castore" = { - device = "/nvme"; - options = [ "bind" ]; - }; - services.nginx.virtualHosts.binary-cache = { enableACME = true; forceSSL = true; @@ -65,6 +71,7 @@ serverAliases = [ "cache.nixos.sh" ]; + locations."/".proxyPass = "http://[::1]:5000"; }; networking.firewall.allowedTCPPorts = [ 80 443 ]; diff --git a/npins/sources.json b/npins/sources.json index 6ff3fa4..c4db85c 100644 --- a/npins/sources.json +++ b/npins/sources.json @@ -7,9 +7,9 @@ "url": "https://git.lix.systems/yu-re-ka/binary-cache" }, "branch": "master", - "revision": "608f8008ebd5e7a535544cbc8df18ea4a64bb66a", + "revision": "bb40996c4b287fb5f1c20efcd086053e3b5e91c6", "url": null, - "hash": "0l9ldfkaamvdchg2b1x1qcs8pv8aqnhiswfmfqyyph4w0m1ky868" + "hash": "1dw6pkqi0vmkh35i17yzfa8jgdqnfgaaxb2ry02m4pg68sfl0llq" }, "nixpkgs": { "type": "Channel",