!dGrjXvKnCwVLevgmzo:matrix.org

Stockholm NixOS meetup group

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

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


SenderMessageTime
26 Apr 2024
@maedas:matrix.orgmaedas
In reply to @lillecarl:matrix.org
Aah, so the intention is creation options that align with the file path?
*

Don't know what __curPos, looks cursed 😄
Final template. Reading a filename elegantly isn't supported by the builtins, the nameBaseOf returns the current dir-name so we reorganized to a folder structure supporting it (and more future proof anyway)

{ config, lib, pkgs, ... }:

let
  name = baseNameOf ./.;
  cfg = lib.getAttr name config.oatmeal;
in
{
  imports = [
  ];

  options.oatmeal.${name} = with lib; {
    enable = mkEnableOption (name + " module");
  };

  config = {
  };
}
00:05:01
@maedas:matrix.orgmaedas`{ config, inputs, secrets, lib, pkgs, ... }: let cfg = config.oatmeal; dir-content = builtins.readDir ./.; in { imports = lib.filter lib.isPath (lib.forEach (lib.attrNames dir-content) (key: if (lib.getAttr key dir-content) == "directory" then (./. + ("/" + key)) else null )) ++ [ ]; options.oatmeal = with lib; { users = mkOption { type = types.listOf types.str; }; }; config = { home-manager = { extraSpecialArgs = { inherit inputs secrets; }; users = lib.foldl' (acc: user: { "${user}" = import (../../users + ("/" + user + "/home.nix")); } // acc) {} cfg.users; }; }; `00:07:29
@maedas:matrix.orgmaedas *
{ config, inputs, secrets, lib, pkgs, ... }:

let
  cfg = config.oatmeal;
  dir-content = builtins.readDir ./.;
in
{
  imports = lib.filter lib.isPath (lib.forEach (lib.attrNames dir-content) (key: if (lib.getAttr key dir-content) == "directory" then (./. + ("/" + key)) else null )) ++ \[
  \];

  options.oatmeal = with lib; {
    users = mkOption {
      type = types.listOf types.str;
    };
  };

  config = {
    home-manager = {
      extraSpecialArgs = { inherit inputs secrets; };
      users =
        lib.foldl'
          (acc: user: { "${user}" = import (../../users + ("/" + user + "/home.nix")); } // acc)
          {}
          cfg.users;
    };
 };
}
00:08:00
@maedas:matrix.orgmaedas *

Module importer/scheduler also got a glow-up, pulling in all modules dynamically from the path.

The single import line is pretty macho though, but I'm pretty happy with it after I figured it out.

{ config, inputs, secrets, lib, pkgs, ... }:

let
  cfg = config.oatmeal;
  dir-content = builtins.readDir ./.;
in
{
  imports = lib.filter lib.isPath (lib.forEach (lib.attrNames dir-content) (key: if (lib.getAttr key dir-content) == "directory" then (./. + ("/" + key)) else null )) ++ \[
  \];

  options.oatmeal = with lib; {
    users = mkOption {
      type = types.listOf types.str;
    };
  };

  config = {
    home-manager = {
      extraSpecialArgs = { inherit inputs secrets; };
      users =
        lib.foldl'
          (acc: user: { "${user}" = import (../../users + ("/" + user + "/home.nix")); } // acc)
          {}
          cfg.users;
    };
 };
}
00:11:21
@erinvanderveen:matrix.orgErin
In reply to @alxplus:matrix.org
Thanks! Speaking of pain points before, this is something I struggle with, trying to figure out what the most appropriate function, in the end whatever I do feels like a series of functions kept together by duct tape and a prayer 😅

Which is mostly correct I think XD

Functional programming has a tendency to feel like that. Especially Nix where there are no real types.

07:24:49
@alxplus:matrix.orgalxplusYeah that's a good point, types help with keeping you on the right track. But no matter, just seeing the kind of stuff you good people are doing helps, like language immersion :)09:07:13
29 Apr 2024
@alxplus:matrix.orgalxplusSo thanks on the tip about starship, the command line prompt. It's just beautiful11:06:29
@mjolnir:nixos.orgNixOS Moderation Botchanged room power levels.15:28:31
1 May 2024
@mjolnir:nixos.orgNixOS Moderation Botchanged room power levels.15:06:06
2 May 2024
@igorramazanov:matrix.orgigorramazanovI really like the NixOS Foundation articles in LinkedIn, but is there an RSS? https://www.linkedin.com/company/nixos-foundation/posts/?feedView=all19:49:02
4 May 2024
@claesatwork:matrix.orgClaesI think you can ask in the Marketing Matrix channel, the people who publish these posts use to be there05:46:02
5 May 2024
@claesatwork:matrix.orgClaesYou can try this. It is NixOS Twitter account using Nitter https://nitter.poast.org/nixos_org/rss20:00:50
8 May 2024
@lillecarl:matrix.orglillecarlhttps://gist.github.com/Lillecarl/2af68098c44ef29ec6da8916c73dd4ab If you just want some packages from nix develop when you enter a directory, cache the PATH for an hour so you don't have to eval if you open and close your shell often12:44:15
@markuskowa:matrix.orgmarkuskowaTo keep the alternating Tuesday/Wednesday scheme: should we meet on Tuesday May 28th? This will probably be the last regular meeting before the summer. Give a thumbs up, thumbs down, or comment.19:11:58
@lillecarl:matrix.orglillecarl
In reply to @lillecarl:matrix.org
https://gist.github.com/Lillecarl/2af68098c44ef29ec6da8916c73dd4ab If you just want some packages from nix develop when you enter a directory, cache the PATH for an hour so you don't have to eval if you open and close your shell often
Idk why I didn't just use symlinkJoin and adding outlink/bin in direnv, much simpler
19:27:52
9 May 2024
@pradipcaulagi:matrix.orgPradip Caulagi
In reply to @markuskowa:matrix.org
To keep the alternating Tuesday/Wednesday scheme: should we meet on Tuesday May 28th? This will probably be the last regular meeting before the summer. Give a thumbs up, thumbs down, or comment.
I will check on the dates for hosting 👍
13:40:15
10 May 2024
@pradipcaulagi:matrix.orgPradip Caulagi
In reply to @markuskowa:matrix.org
To keep the alternating Tuesday/Wednesday scheme: should we meet on Tuesday May 28th? This will probably be the last regular meeting before the summer. Give a thumbs up, thumbs down, or comment.
* I will check on the date for hosting 👍
11:10:53
14 May 2024
@pradipcaulagi:matrix.orgPradip CaulagiPlayground will host again! I was also thinking on sharing on linkedin. Does anyone want to present anything? Their nix journey for example?06:51:05
@claesatwork:matrix.orgClaesHi, I picked up my go / mqtt project again and thus refreshed some nix knowledge related to this. Could show a bit of that. But don't write it on LinkedIn please, I will not be able to prepare anything formal15:27:06
@pradipcaulagi:matrix.orgPradip CaulagiNice! Will skip mentioning on linkedin but look forward to seeing the presentation.20:21:13
@markuskowa:matrix.orgmarkuskowaI was playing around with light weight NixOS nspawn containers. I could show a little bit of that (also not of the level of a fully worked out presentation).20:32:49
@pradipcaulagi:matrix.orgPradip Caulagithis was my post - https://www.linkedin.com/posts/pradipcaulagi_one-of-the-tech-i-am-excited-about-these-activity-7196248141371740160-HO8w?utm_source=share&utm_medium=member_desktop Happy to edit it based on inputs :)20:48:45
20 May 2024
@markuskowa:matrix.orgmarkuskowa20240520_183841.jpg
Download 20240520_183841.jpg
16:41:21
@markuskowa:matrix.orgmarkuskowaA glitch in the system revealed which OS SL is running on their displays.16:42:07
@erinvanderveen:matrix.orgErin
In reply to @markuskowa:matrix.org
A glitch in the system revealed which OS SL is running on their displays.
Disgraceful!
16:54:19

Show newer messages


Back to Room ListRoom Version: 10