!dGrjXvKnCwVLevgmzo:matrix.org

Stockholm NixOS meetup group

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

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


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

Show newer messages


Back to Room ListRoom Version: 10