!dGrjXvKnCwVLevgmzo:matrix.org

Stockholm NixOS meetup group

49 Members
Monthly meetups in Stockholm, Sweden around Nix releated topics(nixos.org)14 Servers

Load older messages


SenderMessageTime
29 Aug 2025
@lillecarl:matrix.orglillecarlSorry for spamming, excited09:59:57
@lillecarl:matrix.orglillecarl * nix-snapshotter solves this by creating one bind mount per storepath instead, which is an approach that only works in the containerd layer, the benefit they get is that they can create container paths outside /nix(i think). With cknix-csi you must write an activation script that copies files from /nix to FHS if you need stuff outside of /nix10:01:30
@claesatwork:matrix.orgClaes
In reply to @lillecarl:matrix.org
The part where we hardlink from the source store to a new "fake store" is where it's unique, just sharing a global /nix with all pods on the host would work, but definitely not for "production" since any application in the cluster could read any other application in the clusters code by travesting the store.

ok this part I misunderstood first

will need more time to look through but definitely innovative!

10:07:13
30 Aug 2025
@claesatwork:matrix.orgClaesI published my secrets management module here : https://github.com/claes/hemlis13:25:39
1 Sep 2025
@lillecarl:matrix.orglillecarl Nice Claes! I'll have a look later tonight 15:12:58
@lillecarl:matrix.orglillecarlI've got a thing to share which I thought can be quite useful. The nix.db database contains a field called "registrationTime" which nix-collect-garbage --delete-older-than Xd uses. I(Claude) wrote a little Python script to "touch" all dependencies (optionally including build dependencies) in the database so that recently built things don't get garbage collected if you run with the age options https://gist.github.com/Lillecarl/a08759fdc8f264eb237e46fd0ef16c40 <- I just tested that it does what I want it to-ish so don't go break your DB with this :p Something something --dry-run and --info also needs sudo because something something sqlite WAL needs write access even when only reading (?). I might just tmpclone the db for read ops πŸ˜„ The reason I made this is to make garbage collection more dynamic for the Nix CSI driver i've been spamming about.15:18:35
@claesatwork:matrix.orgClaesI forgot if it is possible but I would like combine the age limit with a generation limit. Something like gc everything older than 7 days but keep at least 5 generations16:46:43
@b:chreekat.netchreekatThere's https://search.nixos.org/options?channel=25.05&show=boot.loader.grub.configurationLimit&query=grub. but it's a maximum, not a minimum :/17:21:52
@lillecarl:matrix.orglillecarlThe nix sqlite database is really simple. Once I'm done cursing over replacing hardlinks with bind-mounts (hopefully) this'll be a good project19:57:57
@lillecarl:matrix.orglillecarlThe GC could do with a bit more "intelligence". The current one is honestly dumb as WORDS19:58:17
2 Sep 2025
@talyz:matrix.orgtalyzAre any of you coming to nixcon? :)14:21:03
@claesatwork:matrix.orgClaesnot me14:32:04
@markuskowa:matrix.orgmarkuskowaI have to skip this year unfortunately. 14:50:00
14 Sep 2025
@emma:rory.gay@emma:rory.gay joined the room.08:39:46
@soispha:vhack.euBenedikt joined the room.17:36:41
16 Sep 2025
@lillecarl:matrix.orglillecarl markuskowa: I notice you haven't scheduled a next meetup ;) 16:03:36
@markuskowa:matrix.orgmarkuskowa
In reply to @lillecarl:matrix.org
markuskowa: I notice you haven't scheduled a next meetup ;)
You got me 🫠. It was quite busy. What about Tuesday 30th of September?
16:08:11
@lillecarl:matrix.orglillecarlSounds good to me! 😁 16:11:59
@lillecarl:matrix.orglillecarlRedacted or Malformed Event17:26:06
@markuskowa:matrix.orgmarkuskowaWe were alternating between Tuesday and Wednesday to make it the decision easier. 18:15:49
18 Sep 2025
@lillecarl:matrix.orglillecarlhttps://github.com/Lillecarl/dinix I wrote a little thing that generates dinit (the init system) configuration from Nix (using the module system). Dinit is VERY light, the overhead is ~4MB RAM and "no CPU". This enables writing OS and init independent "service collections". It can run as pid1 in Linux (but don't try this), pid1 in containers (reaps zombies and such) or random pid in user mode where it's just a process supervisor. Also works on MacOS (I don't have a Mac machine so I can't verify though). So you could create a service collection with nginx, postgres, whatever and run it from a single nix command. You could even run dinit from a systemd unit if you'd want. So you can run the same service collection from: Containers, Systemd, commandline and Nix brings the executables πŸ˜„ Here's an example nginx module that runs on 8080 and presents "Hello World" https://github.com/Lillecarl/dinix/blob/main/config.nix06:57:54
@lillecarl:matrix.orglillecarl *

https://github.com/Lillecarl/dinix I wrote a little thing that generates dinit (the init system) configuration from Nix (using the module system).

Dinit is VERY light, the overhead is ~4MB RAM and "no CPU". This enables writing OS and init independent "service collections". It can run as pid1 in Linux (but don't try this), pid1 in containers (reaps zombies and such) or random pid in user mode where it's just a process supervisor.

Also works on MacOS (I don't have a Mac machine so I can't verify though). So you could create a service collection with nginx, postgres, whatever and run it from a single nix command. You could even run dinit from a systemd unit if you'd want.

So you can run the same service collection from: Containers, Systemd, commandline and Nix brings the executables πŸ˜„

Here's an example nginx module that runs on 8080 and presents "Hello World" https://github.com/Lillecarl/dinix/blob/main/config.nix

Edit:

//github.com/lillecarl/dinix.git";}){}).config.out.script'```
07:19:54
@lillecarl:matrix.orglillecarl *

https://github.com/Lillecarl/dinix I wrote a little thing that generates dinit (the init system) configuration from Nix (using the module system).

Dinit is VERY light, the overhead is ~4MB RAM and "no CPU". This enables writing OS and init independent "service collections". It can run as pid1 in Linux (but don't try this), pid1 in containers (reaps zombies and such) or random pid in user mode where it's just a process supervisor.

Also works on MacOS (I don't have a Mac machine so I can't verify though). So you could create a service collection with nginx, postgres, whatever and run it from a single nix command. You could even run dinit from a systemd unit if you'd want.

So you can run the same service collection from: Containers, Systemd, commandline and Nix brings the executables πŸ˜„

Here's an example nginx module that runs on 8080 and presents "Hello World" https://github.com/Lillecarl/dinix/blob/main/config.nix

Edit:

nix run --impure --expr '(import (builtins.fetchTree{type="git";url="https:
//github.com/lillecarl/dinix.git";}){}).config.out.script'
07:20:26
@lillecarl:matrix.orglillecarl *

https://github.com/Lillecarl/dinix I wrote a little thing that generates dinit (the init system) configuration from Nix (using the module system).

Dinit is VERY light, the overhead is ~4MB RAM and "no CPU". This enables writing OS and init independent "service collections". It can run as pid1 in Linux (but don't try this), pid1 in containers (reaps zombies and such) or random pid in user mode where it's just a process supervisor.

Also works on MacOS (I don't have a Mac machine so I can't verify though). So you could create a service collection with nginx, postgres, whatever and run it from a single nix command. You could even run dinit from a systemd unit if you'd want.

So you can run the same service collection from: Containers, Systemd, commandline and Nix brings the executables πŸ˜„

Here's an example nginx module that runs on 8080 and presents "Hello World" https://github.com/Lillecarl/dinix/blob/main/config.nix

Edit:

nix run --impure --expr '(import (builtins.fetchTree{type="git";url="https://github.com/lillecarl/dinix.git";}){}).config.out.script'
07:20:37
@markuskowa:matrix.orgmarkuskowaIf the generation of config files would be reusable (I.e. separated in the module system), we could reuse them for dinix, or container image generation. 09:37:16
@kacper.uminski:matrix.orgKacper Uminski Hi, all! I am currently trying to build a stateless cluster using Nixos. The main thing is that I want all things to be wiped on each boot. The idea is to have one management node serving an ipxe image over pxe, a kernel, and an initrd. The ipxe would pull the kernel and initrd, which would then torrent a root tarball, extract it, and kexec/switch_root into it. Does anyone have an idea where to even start with this? I did try nix-generators for the root kexec tarball, but that doesn't seem to work well when you already have a /nix in root already... Any suggestions would be most appreciated! :) 10:45:05
@lillecarl:matrix.orglillecarl
In reply to @markuskowa:matrix.org
If the generation of config files would be reusable (I.e. separated in the module system), we could reuse them for dinix, or container image generation.
Yep, reusable across local dev and in containers, but also if someone makes a dinix module for the "LAMP" stack we could easily stick it into systemd on a VM of your choice
13:23:30
@lillecarl:matrix.orglillecarl
In reply to @kacper.uminski:matrix.org
Hi, all! I am currently trying to build a stateless cluster using Nixos. The main thing is that I want all things to be wiped on each boot. The idea is to have one management node serving an ipxe image over pxe, a kernel, and an initrd. The ipxe would pull the kernel and initrd, which would then torrent a root tarball, extract it, and kexec/switch_root into it. Does anyone have an idea where to even start with this? I did try nix-generators for the root kexec tarball, but that doesn't seem to work well when you already have a /nix in root already... Any suggestions would be most appreciated! :)
Sounds like you've made a few "too many" decisions already. I couldn't help you, I would probably try to make a nixos iPXE image and make the iPXE server a nix build cache instead, build new images when you need new systemd or kernel
13:25:57
@lillecarl:matrix.orglillecarlnixos-anywhere does the kexec thing already work to install nixos over "any" Linux distro, so you could investigate their thing. If you wanna use nix, use nix :p torrents don't belong in Nix (even though they map well to the store immutability) 13:27:19
@julienmalka:matrix.orgJulienMaybe some simple stuff that could work is to setup syncthing on the nixos machine such that when it’s brought up it downloads P2P all the state of the machine13:29:39

Show newer messages


Back to Room ListRoom Version: 10