!CcTBuBritXGywOEGWJ:matrix.org

NixOS Binary Cache Self-Hosting

108 Members
About how to host a very large-scale binary cache and more48 Servers

Load older messages


SenderMessageTime
27 Jun 2024
@hexa:lossy.networkhexa

I've been deep in the docs this past week thinking about how best to implement it

15:40:39
28 Jun 2024
@blitz:chat.x86.lol@blitz:chat.x86.lol left the room.18:09:07
4 Jul 2024
@philiptaron:matrix.org@philiptaron:matrix.org left the room.15:46:20
6 Jul 2024
@sandro:supersandro.deSandro 🐧 joined the room.11:03:12
9 Jul 2024
@sbc64:matrix.orgsbc64 joined the room.16:49:08
11 Jul 2024
@ronnypfannschmidt:matrix.orgRonnyAre there any docs for setting up and gcing a small personal cache, I have a Homeserver on nix that's available via ssh and id like to use it as cache server for personal needs16:25:40
12 Jul 2024
@samrose:matrix.orgsamrose Ronny: one route is to just use it as a remote build machine https://nix.dev/manual/nix/2.18/advanced-topics/distributed-builds. Nix would automatically cache the builds in the nix store of the machine. you can nix build with --keep-outputs to build up the roots you want to keep. 00:09:00
13 Jul 2024
@ronnypfannschmidt:matrix.orgRonny
In reply to @samrose:matrix.org
Ronny: one route is to just use it as a remote build machine https://nix.dev/manual/nix/2.18/advanced-topics/distributed-builds. Nix would automatically cache the builds in the nix store of the machine. you can nix build with --keep-outputs to build up the roots you want to keep.
im building on one of my higher powered systems and have the cache on my rpi sytem (that shouldn't build) - i want to work out something where a github action pushes to the cache eventually
10:19:31
14 Jul 2024
@samrose:matrix.orgsamrose Ronny: that is explained in https://nix.dev/manual/nix/2.22/command-ref/new-cli/nix3-copy you just have to figure out how to securely network to your machine. 10:21:20
@ronnypfannschmidt:matrix.orgRonny
In reply to @samrose:matrix.org
Ronny: that is explained in https://nix.dev/manual/nix/2.22/command-ref/new-cli/nix3-copy you just have to figure out how to securely network to your machine.
this lacks all details on gc-proofing and/or lifecycle management - copied closures dont exactly help with controlling how one reclaims space
10:31:16
@hexa:lossy.networkhexahave you looked at attic so far?11:41:25
@hexa:lossy.networkhexait is a binary cache implementation that uses S3-compatible backends11:42:13
@hexa:lossy.networkhexahttps://github.com/zhaofengli/attic11:42:15
@hexa:lossy.networkhexagc is documented here https://docs.attic.rs/tutorial.html#garbage-collection11:42:34
@hexa:lossy.networkhexai'm using it with a local garage setup, and the same would likely work with minio, or some hosted setup11:44:02
@hexa:lossy.networkhexaif you're interested I can share the config that I run on my local rock5b11:50:09
@ronnypfannschmidt:matrix.orgRonnyi have taken a look at attic, however as my server has also the largest deploy set, i was hoping to enable using its store directly as a cache instead of creating a extra deployed service (when ssh and filesystem are kinda there)13:14:43
@hexa:lossy.networkhexa you can use harmonia to serve your /nix/store 13:18:33
@hexa:lossy.networkhexa * you can use harmonia to serve your /nix/store 13:18:44
@hexa:lossy.networkhexait has no gc semantics beyond what the nix store already offers13:19:12
@ronnypfannschmidt:matrix.orgRonnyhmm, man, so unless i use a different cache with a different store, i get no gc for the system that wont nke cache by accident13:21:57
@hexa:lossy.networkhexaone tricky thing about nix and caches that collect garbage is a very high postive ttl for narinfo files in nix's defaults https://nix.dev/manual/nix/2.18/command-ref/conf-file#conf-narinfo-cache-positive-ttl13:22:04
@hexa:lossy.networkhexa * one tricky thing about nix and caches that collect garbage is a very high postive ttl (30 days) for narinfo files in nix's defaults https://nix.dev/manual/nix/2.18/command-ref/conf-file#conf-narinfo-cache-positive-ttl13:22:52
@hexa:lossy.networkhexa * one tricky thing about nix and caches that collect garbage is a very high postive ttl (30 days) for narinfo files in its defaults https://nix.dev/manual/nix/2.18/command-ref/conf-file#conf-narinfo-cache-positive-ttl13:23:02
@hexa:lossy.networkhexawell, you could manage gcroots for the closures you want to keep13:23:48
@hexa:lossy.networkhexathis is basically the same mechanic that prevents gc from removing things that shouldn't be removed13:24:35
@hexa:lossy.networkhexa * this is basically the same mechanic that prevents gc from removing things that shouldn't be removed, like your system closure13:24:42
@hexa:lossy.networkhexa * this is basically the same mechanic that prevents gc from removing things that shouldn't be removed, like your recent system closures13:24:54
@ronnypfannschmidt:matrix.orgRonnyso based on what i understood so far - there is no nix-native binary cache mechanism - gc will jsut kill unless one does messy gc root hacks13:26:12
@hexa:lossy.networkhexacorrect13:26:43

Show newer messages


Back to Room ListRoom Version: 10