!wfudwzqQUiJYJnqfSY:nixos.org

NixOS Module System

152 Members
31 Servers

Load older messages


SenderMessageTime
24 Nov 2025
@hsjobeki:matrix.orghsjobekiThough i am not sure what the benefit of merging without checking is. Checks are usually shallow and shouldnt change the lazyness. If the value is not of the expected type, merging it would also fail 16:50:33
@roberthensing:matrix.orgRobert Hensing (roberth)If you want merging without checking, you can still construct a type that achieves that16:51:02
@roberthensing:matrix.orgRobert Hensing (roberth) But yeah, generally the check is simple because otherwise you're inducing unnecessary strictness, as in non-laziness 16:51:36
@roberthensing:matrix.orgRobert Hensing (roberth)=> infinite recursions16:51:54
@hsjobeki:matrix.orghsjobekiDo you suspect a breaking change in lazyness between just merge and checkAndMerge ?16:54:48
@hsjobeki:matrix.orghsjobekiWe dont have any reports, or at least i didnt get pinged in any issues regarding that. 16:55:47
@n4ch723hr3r:nope.chat@n4ch723hr3r:nope.chatdo i have to use systemd.tmpfiles?16:56:55
@mattsturg:matrix.orgMatt Sturgeon
In reply to @n4ch723hr3r:nope.chat
do i have to use systemd.tmpfiles?
This room is for discussing the module system itself, not NixOS and its options. You want https://matrix.to/#/!6oudZq5zJjAyrxL2uY:0upti.me
17:16:25
@vivekanandan_ks:matrix.orgvivekanandan_ks Hi All,
What do u all think about the flake-parts?
Is that somehow making the current modules system better?
Or it helps the current modules to be easy?
17:59:32
@mattsturg:matrix.orgMatt Sturgeon

Flake-parts uses the module system to construct flake outputs. Just like how NixOS uses the module system to construct an OS, or Home Manager uses the module system to construct a user's profile.

I'm not sure what you're asking about how it interacts with "current" modules, or what you mean by "current" 🙂

18:20:35
@n4ch723hr3r:nope.chat@n4ch723hr3r:nope.chati think hes asking for an opinion about flake.parts18:43:44
26 Nov 2025
@hsjobeki:matrix.orghsjobeki I'd say i don't have a general opinion.
If you develop a third party nix library that other people depend on every input that you have adds to their dependencies as well.
That is how flake dependencies behave. And everyone needs to pin nixpkgs-lib of flake-parts otherwise you get their version, which is an extra 50MB download.
Other than that if you are using it for your own project that doesn't have dependents it is in my opinion a good UX, which lets you leverage the module system to decompose the components of your flake.
16:33:29
@roberthensing:matrix.orgRobert Hensing (roberth) it now uses a small lib-only flake fwiw, but the override still makes sense to have 16:39:27
30 Nov 2025
@3wy-kra:matrix.uni-hannover.deMasen Joumaah joined the room.20:47:28
1 Dec 2025
@brisingr05:matrix.orgBrisingr changed their display name from Brisingr05 to Brisingr.18:39:52
2 Dec 2025
@i-am-logger:matrix.orgIdo Samuelson joined the room.09:35:25
4 Dec 2025
@isabel:isabelroses.comisabel changed their profile picture.16:41:35
6 Dec 2025
@hosaidenpwd:matrix.orgP J joined the room.07:44:51
10 Dec 2025
@jmanch:matrix.orgJManch joined the room.23:23:03
11 Dec 2025
@tg-x:asra.grTG × ⊙ joined the room.19:54:05
13 Dec 2025
@mjolnir:nixos.orgNixOS Moderation Bot unbanned @mightyiam:matrix.org@mightyiam:matrix.org.05:59:21
14 Dec 2025
@n4ch723hr3r:nope.chat@n4ch723hr3r:nope.chat changed their display name from n4ch723hr3r to n4ch723hr3r (stuff in name is cringe).03:42:57
@suua:matrix.orgsuua joined the room.13:29:46
15 Dec 2025
@n4ch723hr3r:nope.chat@n4ch723hr3r:nope.chat changed their display name from n4ch723hr3r (stuff in name is cringe) to MOVED TO n4ch7@n3831.net.00:16:12
16 Dec 2025
@n4ch7:n3831.netn4ch723hr3r (putting stuff in your name is cringe) joined the room.04:30:36
@n4ch723hr3r:nope.chat@n4ch723hr3r:nope.chat left the room.04:30:46
19 Dec 2025
@zsuperx:matrix.orgzsuper joined the room.02:37:47
@zsuperx:matrix.orgzsuperim writing a NixOS module for the bore TCP tunnel service. So far I have a working version in my own flake that im using in a few of my servers right now: https://github.com/zSuperx/nix-bore. But I was thinking that this could be nice to have within nixpkgs itself as a builtin module, so I'm going through the contributing guide for modules and editing some of the types and whatnot. These are the questions I have right now: Since the module im writing has options for setting ports, im assuming i should be using type = lib.types.port whenever possible? Likewise, I'm adding a secretFile option so the systemd service reads the secret from a file rather than plaintext. Should I be using type = lib.types.path for this option? I see a few path options in the type definitions file for nixpkgs, so just wanted to double check. When actually evaluating and creating the systemd service file, since the set options values are being processed and interpolated into the serviceConfig.ExecStart bash script, when should I be using lib.escapeShellArg(s)? and last thing (for now) that im unsure about is the use of lib.literalExpression. I see it show up in a few modules I've been reading here and there, but I don't know what the actual use-case is or when it's preferred over a string. sorry if this is a lot of text to send at once. I had originally asked someone via the NixOS discord, and they directed me here. Let me know if I should post this in a different channel or something.02:40:31
@zsuperx:matrix.orgzsuper *

im writing a NixOS module for the bore TCP tunnel service. So far I have a working version in my own flake that im using in a few of my servers right now: https://github.com/zSuperx/nix-bore. But I was thinking that this could be nice to have within nixpkgs itself as a builtin module, so I'm going through the contributing guide for modules and editing some of the types and whatnot. These are the questions I have right now:

Since the module im writing has options for setting ports, im assuming i should be using type = lib.types.port whenever possible?

Likewise, I'm adding a secretFile option so the systemd service reads the secret from a file rather than plaintext. Should I be using type = lib.types.path for this option? or just lib.types.str? I see a few path options in the type definitions file for nixpkgs, so just wanted to double check.

When actually evaluating and creating the systemd service file, since the set options values are being processed and interpolated into the serviceConfig.ExecStart bash script, when should I be using lib.escapeShellArg(s), if at all?

and last thing (for now) that im unsure about is the use of lib.literalExpression. I see it show up in a few modules I've been reading here and there, but I don't know what the actual use-case is or when it's preferred over a string for an option's description.

sorry if this is a lot of text to send at once. I had originally asked someone via the NixOS discord, and they directed me here. Let me know if I should post this in a different channel or something.

02:42:43
@zsuperx:matrix.orgzsuper *

im writing a NixOS module for the bore TCP tunnel service. So far I have a working version in my own flake that im using in a few of my servers right now: https://github.com/zSuperx/nix-bore. But I was thinking that this could be nice to have within nixpkgs itself as a builtin module, so I'm going through the contributing guide for modules and editing some of the types and whatnot. These are the questions I have right now:

Since the module im writing has options for setting ports, im assuming i should be using type = lib.types.port whenever possible?

Likewise, I'm adding a secretFile option so the systemd service reads the secret from a file rather than plaintext. Should I be using type = lib.types.path for this option? or just lib.types.str? I see a few path options in the type definitions file for nixpkgs, so just wanted to double check.

When actually evaluating and creating the systemd service file, since the set options values are being processed and interpolated into the serviceConfig.ExecStart bash script, when should I be using lib.escapeShellArg(s), if at all?

and last thing (for now) that im unsure about is the use of lib.literalExpression. I see it show up in a few modules I've been reading here and there, but I don't know what the actual use-case is or when it's preferred over a string for an option's description.

sorry if this is a lot of text to send at once. I had originally asked someone via the NixOS discord, and they directed me here. Let me know if I should post this in a different channel or something. And thanks in advance!

02:43:26

Show newer messages


Back to Room ListRoom Version: 10