!9IQChSjwSHXPPWTa:lix.systems

Lix

1102 Members
Lix user channel. Feel free to discuss on-topic issues here and give each other help. For matrix.to links to the rest of the Lix channels, see: https://wiki.lix.systems/books/lix-organisation/page/matrix-rooms294 Servers

Load older messages


SenderMessageTime
16 Oct 2025
@somasis:matrix.orgsomasis I think one of the things that trips me up with flakes vs. non flakes is how nixos-rebuild finds the host you're trying to build, compared to when it's expecting a non-flake configuration; it seems like you're not expected to have multiple hosts in one configuration directory in non-flakes style, yet you are with flakes. so it makes me wonder if there's practices people have came up with for maintaining some of the nice stuff about flake-oriented configuration style without relying on flakes 02:31:07
@ekler:feel-co.orgekler

i would still use the hosts/*.nix setup, where each file is an entry-point for a respective host, and use -I nixos-config=hosts/thishost.nix or whatnot

02:34:03
@ekler:feel-co.orgekler

obv that's not the only way to do it, but it works for me

02:34:19
@mjm:midna.devmjmyeah that's a decent way. i skip nixos-rebuild entirely and build the config through my own tool, doing equivalent steps to what nixos-rebuild would do02:35:34
@somasis:matrix.orgsomasis makes sense 02:35:52
@charles:computer.surgeryCharlesi use (and disclaimer: maintain) this https://git.afnix.fr/sprinkles/sprinkles with lon (but you can use whatever pinning tool) and if you want a practical example my dotfiles repo is https://gitlab.computer.surgery/charles/dotfiles (also i just noticed the readme is a little outdated)02:37:54
@charles:computer.surgeryCharlesthere's also https://github.com/nilla-nix/nilla which has a similar goal but is different02:39:21
@charles:computer.surgeryCharlesyou can tell nixos-rebuild to use an arbitrary attribute path from an arbitrary nix file02:40:09
@charles:computer.surgeryCharles (though i tried this a long time ago and ran into some issues so i wrote my own, terrible-r version of nixos-rebuild which is https://gitlab.computer.surgery/charles/dotfiles/-/blob/dae8665ee2961c14af67e0eeea95eea993d504bc/bin/system) 02:41:37
@psentee:matrix.orgPsentee somasis: I'm right now switching to npins+nilla, nilla's built on aux lib modules and quite nice to use, but not well documented, and I'm using raw nix -f ./nilla.nix … more than their nilla CLI. If you want to take a look at some actual config, public pieces of mine are at https://codeberg.org/psentee/etwa/, and there's also a more complex https://github.com/jakehamilton/config/ using the same tools 08:52:51
@lillecarl:matrix.orglillecarl
nix build --refresh --impure --print-out-paths --out-link /nix/var/nix/gcroots/nix-csi/csi16a0b640557000b87a44b5798b8c964ee33f0381815d40f9917e78dd32fb7b81 --file /tmp/tmpjmw9i720.nix
nix-csi-node-sg8p6 nix-csi-node 2025-10-16 10:15:37,979 DEBUG [nix-csi] warning: error: unable to download 'http://nix-cache.default.svc/87bdp04miawiffqc9k8n2m2p172fx6dj.narinfo': Failed to connect to nix-cache.default.svc port 80 after 0 ms: Could not connect to server (curl error code=7); retrying in 2591 ms (attempt 4/5)

Could someone explain how this makes sense, shouldn't --refresh bypass the unreachable cache?

10:19:57
@raitobezarius:matrix.orgraitobezariusisn't --refresh only about refreshing eval-time artifacts?10:21:56
@raitobezarius:matrix.orgraitobezariusif you want to bypass an unreachable cache, you should either disable it to avoid paying the expbackoff timeouts or accept the expbackoff timeouts10:22:42
@raitobezarius:matrix.orgraitobezarius(or pass --offline but its chance of successes are meager, this feature is broken)10:23:09
@lillecarl:matrix.orglillecarl
    narinfo-cache-negative-ttl = 0
    narinfo-cache-positive-ttl = 0

I've got these set in config too. The problem is that I'm bootstrapping the nix cache that isn't working and the build doesn't continue here at all.
You think the best way is parsing the error messages for "warning: error: unable to download" and rerun the build without the cache configured? It'll be hard to do "properly"

10:26:54
@lillecarl:matrix.orglillecarl(It's been up once before obviously :P)10:27:22
@raitobezarius:matrix.orgraitobezariusI don't think that's the best way10:27:24
@raitobezarius:matrix.orgraitobezariusYou should maybe tinker with the connect-timeouts?10:27:34
@raitobezarius:matrix.orgraitobezariusand the number of allowed attempts?10:27:42
@raitobezarius:matrix.orgraitobezarius max-connect-timeout, initial-connect-timeout, download-attempts 10:28:24
@raitobezarius:matrix.orgraitobezarius(on lix HEAD)10:28:28
@lillecarl:matrix.orglillecarl

I mean the cache is 100% dead since the builder can't build the volume the cache needs to run :P

nix-csi-node-sg8p6 nix-csi-node 2025-10-16 10:26:32,952 DEBUG [nix-csi] warning: error: unable to download 'http://nix-cache.default.svc/87bdp04miawiffqc9k8n2m2p172fx6dj.narinfo': Failed to connect to nix-cache.default.svc port 80 after 0 ms: Could not connect to server (curl error code=7); retrying in 330 ms (attempt 1/5)
nix-csi-node-sg8p6 nix-csi-node 2025-10-16 10:26:33,282 DEBUG [nix-csi] warning: error: unable to download 'http://nix-cache.default.svc/87bdp04miawiffqc9k8n2m2p172fx6dj.narinfo': Failed to connect to nix-cache.default.svc port 80 after 0 ms: Could not connect to server (curl error code=7); retrying in 622 ms (attempt 2/5)
nix-csi-node-sg8p6 nix-csi-node 2025-10-16 10:26:33,905 DEBUG [nix-csi] warning: error: unable to download 'http://nix-cache.default.svc/87bdp04miawiffqc9k8n2m2p172fx6dj.narinfo': Failed to connect to nix-cache.default.svc port 80 after 0 ms: Could not connect to server (curl error code=7); retrying in 1053 ms (attempt 3/5)
nix-csi-node-sg8p6 nix-csi-node 2025-10-16 10:26:34,958 DEBUG [nix-csi] warning: error: unable to download 'http://nix-cache.default.svc/87bdp04miawiffqc9k8n2m2p172fx6dj.narinfo': Failed to connect to nix-cache.default.svc port 80 after 0 ms: Could not connect to server (curl error code=7); retrying in 2792 ms (attempt 4/5)
nix-csi-node-sg8p6 nix-csi-node 2025-10-16 10:26:37,761 DEBUG [nix-csi] error: unable to download 'http://nix-cache.default.svc/87bdp04miawiffqc9k8n2m2p172fx6dj.narinfo': Failed to connect to nix-cache.default.svc port 80 after 0 ms: Could not connect to server (curl error code=7)
nix-csi-node-sg8p6 nix-csi-node 2025-10-16 10:26:37,779 ERROR [nix-csi] nix build (expression) failed: build.returncode=1
10:28:38
@lillecarl:matrix.orglillecarlI don't mind waiting, but it's failing rather than continuing10:28:51
@raitobezarius:matrix.orgraitobezariusit's curious that it doesn't fallback to build10:29:07
@raitobezarius:matrix.orgraitobezariusare you sure it would succeed building?10:29:20
@raitobezarius:matrix.orgraitobezarius if you pass --substituters '' ? 10:29:28
@lillecarl:matrix.orglillecarlYep, I've built this 100 times before 😄10:30:04
@lillecarl:matrix.orglillecarl
    # Use root as builder since that's the only user in the container.
    build-users-group = root
    # Auto allocare uids so we don't have to create lots of users in containers
    auto-allocate-uids = true
    # Enable common features
    experimental-features = nix-command flakes auto-allocate-uids fetch-closure pipe-operator
    # Don't cache anything that can cause Nix to not try other caches on failure.
    narinfo-cache-negative-ttl = 0
    narinfo-cache-positive-ttl = 0
    # binary cache configuration
    ${lib.optionalString config.enableBinaryCache ''
      trusted-public-keys = ${builtins.readFile ../cache-public} cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=
      substituters = http://nix-cache.${config.namespace}.svc https://cache.nixos.org
    ''}
    # Fuck purity
    warn-dirty = false

This is the full nix.conf, I don't think there's anything special here other than setting the cache values to 0 (which I don't wanna do but I thought it'd fix this issue)

10:31:32
@raitobezarius:matrix.orgraitobezarius
# Use root as builder since that's the only user in the container.

build-users-group = root

10:32:42
@raitobezarius:matrix.orgraitobezariusaoutch10:32:43

Show newer messages


Back to Room ListRoom Version: 10