!dGrjXvKnCwVLevgmzo:matrix.org

Stockholm NixOS meetup group

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

You have reached the beginning of time (for this room).


SenderMessageTime
13 Aug 2025
@309avklarat:matrix.orgSerakhtis left the room.21:36:06
23 Aug 2025
@lillecarl:matrix.orglillecarl

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.orglillecarlFor 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

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 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.orglillecarlQuick reminder: Today is this Wednesday! 😄12:10:27
@lillecarl:matrix.orglillecarl* 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$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 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.orglillecarlIf 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(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

Show newer messages


Back to Room ListRoom Version: 10