!dGrjXvKnCwVLevgmzo:matrix.org

Stockholm NixOS meetup group

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

Load older messages


SenderMessageTime
3 Aug 2025
@lillecarl:matrix.orgLilleCarl (Salsa9) *

I learned how to do a really cursed thing today: edit /nix/store paths

sudo unshare --mount bash -c 'mount -your /nix to /nix && touch /nix/store/something-cursed'

My goal wasn't to edit storepaths but to hardlink to the store, which requires being on the same mount point (which /nix/store isn't because it's RO bind-mounted over itself)

21:16:28
@lillecarl:matrix.orgLilleCarl (Salsa9) *

I learned how to do a really cursed thing today: edit /nix/store paths

sudo unshare --mount bash -c 'mount -your /nix to /nix && touch /nix/store/something-cursed'

My goal wasn't to edit storepaths but to hardlink to the store, which requires being on the same mount point (which /nix/store isn't because it's RO bind-mounted over itself)

unshare --mount creates your own mount namespace (ish) where you get a clone of what is already, but you can mount over things without disrupting any other processes.

21:17:59
4 Aug 2025
@markuskowa:matrix.orgmarkuskowaI hope everyone had a great summer. Let's start up the new meetup season on Wednesday the 27th at the Nordic light hotel. Give it a thumbs up if you are planning to join.20:13:26
8 Aug 2025
@0x4a6f:nixos.dev0x4A6F joined the room.07:07:10
11 Aug 2025
@alxplus:matrix.orgalxplus👍18:28:49
12 Aug 2025
@ahbk:matrix.orgI use NixOS btw
In reply to @lillecarl:matrix.org
https://github.com/water-sucks/optnix Haha sry i forgot to link the most essential thing! 😄

I was going to try this and saw that the maintainer (water-sucks) has integrated this tool along with other neat stuff in a unified nixos-cli. Its beta though and I got a strange error about mailserver.fqdn not being set, but apart from that it went fine and optnix is indeed very nice to use. Thanks for the tips 🤗

https://github.com/nix-community/nixos-cli

06:55:19
13 Aug 2025
@309avklarat:matrix.org@309avklarat:matrix.org left the room.21:36:06
23 Aug 2025
@lillecarl:matrix.orgLilleCarl (Salsa9)

If you're tracking a branch of some kind of repo and don't really care about purity, trust the supply chain and just want to get the latest stuff you can use "fetchTree" in impure evaluation to fetch the the hottest shit out there. By default it uses a 1 hour cache to not fetch every time.

      testFetchTree = builtins.fetchTree {
        type = "github";
        repo = "nixpkgs";
        owner = "NixOS";
        ref = "master";
      };

My understanding from reading github comments and whatnot is that it's using the same paths as flakes use for it's inputs.

https://asciinema.org/a/QW02t4oWnM8zBI8JSov4VysmF

14:17:26
@lillecarl:matrix.orgLilleCarl (Salsa9)For home/personal use --impure should be the default IMO. You can use builtins.getEnv to read environment variables and you can read files anywhere on the filesystem, not just the sacred repo. (Non-flake users don't have this problem since everything is --impure by default :))14:34:16
@lillecarl:matrix.orgLilleCarl (Salsa9)

I AI'd if --impure can be enabled by default and just now stumbled on a feature I hadn't heard about before! The option allow-unsafe-native-code-during-evaluation gives you a new builtin function called builtins.exec which can be used like this:

nix-repl> :p builtins.fromJSON (builtins.exec [ ./test.fish ])
{
  active = true;
  age = 25;
  name = "test-user";
  tags = [
    "developer"
    "nix"
    "json"
  ];
}
# test.fish
#! /usr/bin/env fish

echo "''"
echo '
{
  "name": "test-user",
  "age": 25,
  "active": true,
  "tags": ["developer", "nix", "json"]
}'
echo "''"

(It parses output as a Nix expression so i had to wrap the json in '' '' so it's treated as a string by Nix)

I'm definitely gonna dive deeper into usecases for this, as everything Nix it'll stall evaluation so don't do extremely slow things :)

14:49:37
@markuskowa:matrix.orgmarkuskowa
In reply to @lillecarl:matrix.org
For home/personal use --impure should be the default IMO. You can use builtins.getEnv to read environment variables and you can read files anywhere on the filesystem, not just the sacred repo.
(Non-flake users don't have this problem since everything is --impure by default :))
In the pre-flake world (where most of my code lives), impure is the default. I use it to provide license keys, cpu optimization flags via env or configuration files.
15:29:34
24 Aug 2025
@lillecarl:matrix.orgLilleCarl (Salsa9) This is the way, I use flake-compat(lix) 😄 22:55:56
25 Aug 2025
@markuskowa:matrix.orgmarkuskowaQuick reminder: we meet this Wednesday at 18:00 at the Nordic Light hotel ((Vasagatan 11, Stockholm)).19:06:57
27 Aug 2025
@lillecarl:matrix.orgLilleCarl (Salsa9)Quick reminder: Today is this Wednesday! 😄12:10:27
@lillecarl:matrix.orgLilleCarl (Salsa9)* Quick reminder: Today is this Wednesday! 😄 Edit: I'm feeling some pressure having my Kubernetes thing in a demoable state 12:11:10
@aevl:matrix.orgAndersNewcomer to the meetup here. Where in the hotel are we meeting?15:41:05
@lillecarl:matrix.orgLilleCarl (Salsa9)$somewhere in the lobby, look for nerds 😄15:41:26
@aevl:matrix.orgAndersI will do my best! If anyone arrives early then feel free to come say hello to me. I am the guy with long hair and (not so long) beard sitting with my computer at a round table in the bar section.15:43:47
@lillecarl:matrix.orgLilleCarl (Salsa9) Thanks for today, @claesatwork:matrix.org: looking forward to see your "simple secrets" solution! 😁 If anyone is curious for how the cknix store copy works it's here: https://github.com/Lillecarl/cknix/blob/main/createstore.py Plumbum shall be replaced with native subprocess (so I can do async properly) and all but hardlinks will be removed since it'll use bind mount for RO and overlayfs for RW mounts :) 19:26:03
@lillecarl:matrix.orgLilleCarl (Salsa9)If anyone is running a non-critical Kubernetes and would like to try it out, please shout-out to give me motivation to actually get it out of WIP :p19:27:06
@lillecarl:matrix.orgLilleCarl (Salsa9)(and most subprocess calls could probably be native python instead now that we only need hardlinks, but "cp" is pretty good) 19:28:19
@claesatwork:matrix.orgClaesthanks, I will try to show you next time!21:09:07
@palsternacka:matrix.orgpalsternacka joined the room.21:09:24
@chrillefkr:matrix.orgchrillefkr joined the room.21:53:53
28 Aug 2025
@lillecarl:matrix.orgLilleCarl (Salsa9)
In reply to @claesatwork:matrix.org
thanks, I will try to show you next time!
Nice! Remembered https://search.nixos.org/options?channel=unstable&query=zramSwap ? :)
11:41:18
@claesatwork:matrix.orgClaes
In reply to @lillecarl:matrix.org
Nice! Remembered https://search.nixos.org/options?channel=unstable&query=zramSwap ? :)
I will definitely enable it on at least one of my NixOS hosts. Seems too good to be true :-)
13:08:27
@kraem:ne.bul.aekraemit truly is like https://web.archive.org/web/20090826232515/http://www.downloadmoreram.com/ :)13:12:56
@lillecarl:matrix.orgLilleCarl (Salsa9)
In reply to @claesatwork:matrix.org
I will definitely enable it on at least one of my NixOS hosts. Seems too good to be true :-)

Virtual memory is dark magic only special kernel wizards with superpowers can comprehend. All I know is those wizards want you to have a good amount of swap space so they can perform their spells without constraints.

(Honestly actually really: Swap is essential even if you have boatloads of RAM since it uses LRU to keep hot shit in fast memory and yesteryears Zara collection on the bench, everyone who says you don't need swap haven't spoken to the superpowered wizards)

13:21:36
@claesatwork:matrix.orgClaesThat disk swap is good, that I think is obvious. It is just an addition to RAM. But that taking part of the RAM and compressing data into it, is less obvious. But I will definitely try17:29:01
@lillecarl:matrix.orgLilleCarl (Salsa9)https://asciinema.org/a/I6RXVGmCyCcHnXInvh5DKph4C read-write nix store in kubernetes with overlayfs 😄 yayy17:49:38

Show newer messages


Back to Room ListRoom Version: 10