!tDnwWRNkmmYtMXfaZl:nixos.org

Nix Language

1361 Members
Nix programming language238 Servers

Load older messages


SenderMessageTime
23 Apr 2024
@mxplr:matrix.orgmxpit doesnt make sense "yet" to me, to add a parameter that you wont use, or dont know how to call20:20:16
@qyriad:katesiria.orgQyriad See also: the callPackage pattern, which essentially every package in Nixpkgs is written using, where arguments are all filled in from pkgs 20:20:44
@grimmauld:grimmauld.deGrimmauld
In reply to @qyriad:katesiria.org
Those are NixOS modules, called with lib.evalModules, which automatically fills in argument listed in there from pkgs
wait so evalModules eliminates the need to do inherit on import? I'll have to take a look!
20:21:37
@mxplr:matrix.orgmxp set a profile picture.20:21:45
@qyriad:katesiria.orgQyriadnot entirely sure what you mean, but possibly?20:25:26
@mxplr:matrix.orgmxp
In reply to @qyriad:katesiria.org
Those are NixOS modules, called with lib.evalModules, which automatically fills in argument listed in there from pkgs
so lib.evalModules is call somehow, and will fill dynamically some arguments from pkgs? ๐Ÿคจ
20:28:45
@qyriad:katesiria.orgQyriad lib.evalModules is just the function that handles the entrypoint to the NixOS module system 20:30:18
@mxplr:matrix.orgmxpi'm starting from scratch : https://nix.dev/tutorials/nix-language#function-libraries , in this lesson, there is this example 20:31:08
@mxplr:matrix.orgmxp { pkgs, ... }: pkgs.lib.strings.removePrefix "no " "no true scotsman" 20:31:19
@mxplr:matrix.orgmxp there is only one use of pkgs, i dont get the point of the ... here, as it's not use anywhere, and i dont think it's required 20:31:54
@qyriad:katesiria.orgQyriadOh that's what you meant, sorry20:32:35
@qyriad:katesiria.orgQyriad The ... just means the function won't error if its passed arguments other than the ones named 20:32:51
@mxplr:matrix.orgmxpno worry, it's not easy to ask a clear question, when things are bluerry in your mind20:33:33
@mxplr:matrix.orgmxp
In reply to @qyriad:katesiria.org
The ... just means the function won't error if its passed arguments other than the ones named
AH!!!!! ok !
20:33:47
@qyriad:katesiria.orgQyriad
let
  fn = { a, b, ... }: [ a b ];
in fn { a = 5; b = 10; c = 50; anyOtherArguments = "perfectly fine"; }
20:33:56
@mxplr:matrix.orgmxp
In reply to @mxplr:matrix.org
AH!!!!! ok !
it was on the lesson, but i didn't get that it was for this reason
20:34:10
@qyriad:katesiria.orgQyriadotherwise it will say something like "error: unexpected argument"20:34:13
@qyriad:katesiria.orgQyriadahhh20:34:20
@qyriad:katesiria.orgQyriadsounds like that lesson could use a little more clarity lol20:34:28
@mxplr:matrix.orgmxpit was clear when i read it20:34:40
@grimmauld:grimmauld.deGrimmauldNix has some weird syntax. To this day i have not properly understood both // and @ But learning is the nice part!20:34:53
@mxplr:matrix.orgmxpbut i not when it was used in another context20:34:57
@mxplr:matrix.orgmxp
In reply to @grimmauld:grimmauld.de
Nix has some weird syntax. To this day i have not properly understood both // and @
But learning is the nice part!
yeah, that's true, i'm starting since yesterday, it's tough, but i guess it's also because learning new things, required you another mindset as well
20:35:50
@mxplr:matrix.orgmxp thank you sir Qyriad 20:36:28
@qyriad:katesiria.orgQyriadnp20:36:33
@qyriad:katesiria.orgQyriad
In reply to@grimmauld:grimmauld.de
Nix has some weird syntax. To this day i have not properly understood both // and @ But learning is the nice part!
I can try to explain these if you'd like
20:36:45
@grimmauld:grimmauld.deGrimmauld
In reply to @mxplr:matrix.org
yeah, that's true, i'm starting since yesterday, it's tough, but i guess it's also because learning new things, required you another mindset as well
https://noogle.dev/
here is a bookmark you should set, life saver for lib functions
20:37:10
@grimmauld:grimmauld.deGrimmauld
In reply to @qyriad:katesiria.org
I can try to explain these if you'd like
go ahead, bu i tried before. I somewhat have an idea about @, so lets do // and we call it a day, fair?
20:37:39
@qyriad:katesiria.orgQyriad๐Ÿ‘๏ธ20:38:12
@grimmauld:grimmauld.deGrimmauldLooking at the useages in code search // always looks like a weird frankenstein between mkMerge and .override, but nailing it down good enough for me to apply it hasn't succeeded yet20:41:25

Show newer messages


Back to Room ListRoom Version: 6