23 Apr 2024 |
mxp | it doesnt make sense "yet" to me, to add a parameter that you wont use, or dont know how to call | 20:20:16 |
Qyriad | 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 | 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 |
| mxp set a profile picture. | 20:21:45 |
Qyriad | not entirely sure what you mean, but possibly? | 20:25:26 |
mxp | 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 | lib.evalModules is just the function that handles the entrypoint to the NixOS module system | 20:30:18 |
mxp | i'm starting from scratch : https://nix.dev/tutorials/nix-language#function-libraries , in this lesson, there is this example | 20:31:08 |
mxp | { pkgs, ... }: pkgs.lib.strings.removePrefix "no " "no true scotsman" | 20:31:19 |
mxp | 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 | Oh that's what you meant, sorry | 20:32:35 |
Qyriad | The ... just means the function won't error if its passed arguments other than the ones named | 20:32:51 |
mxp | no worry, it's not easy to ask a clear question, when things are bluerry in your mind | 20:33:33 |
mxp | 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 | let
fn = { a, b, ... }: [ a b ];
in fn { a = 5; b = 10; c = 50; anyOtherArguments = "perfectly fine"; }
| 20:33:56 |
mxp | 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 | otherwise it will say something like "error: unexpected argument" | 20:34:13 |
Qyriad | ahhh | 20:34:20 |
Qyriad | sounds like that lesson could use a little more clarity lol | 20:34:28 |
mxp | it was clear when i read it | 20:34:40 |
Grimmauld | Nix has some weird syntax. To this day i have not properly understood both // and @
But learning is the nice part! | 20:34:53 |
mxp | but i not when it was used in another context | 20:34:57 |
mxp | 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 |
mxp | thank you sir Qyriad | 20:36:28 |
Qyriad | np | 20:36:33 |
Qyriad | 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 | 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 | 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 | ๐๏ธ | 20:38:12 |
Grimmauld | Looking 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 yet | 20:41:25 |