!tDnwWRNkmmYtMXfaZl:nixos.org

Nix Language

1927 Members
Nix programming language360 Servers

Load older messages


SenderMessageTime
7 Jun 2021
@sternenseemann:systemli.orgsterni (he/him) You can determine { foo }: let inherit (foo) a; in a lexically 10:06:46
@siraben:matrix.orgsiraben (he/him) * oh well x in with x; e is not syntax here 10:06:46
@sternenseemann:systemli.orgsterni (he/him) but { foo }: with foo; a not 10:06:57
@siraben:matrix.orgsiraben (he/him)Right.10:07:01
@siraben:matrix.orgsiraben (he/him)So it actually makes sense then heh10:07:09
@siraben:matrix.orgsiraben (he/him)weird10:07:11
@sternenseemann:systemli.orgsterni (he/him) siraben: I guess in your specific case you could argue that it would be possible lexically, but only be cause it is a very simple case 10:07:26
@sternenseemann:systemli.orgsterni (he/him)where the set is hard coded in place essentially10:07:41
@siraben:matrix.orgsiraben (he/him) I think the thesis gives a desugaring step for with constructs 10:07:45
@siraben:matrix.orgsiraben (he/him)RIght.10:07:49
@siraben:matrix.orgsiraben (he/him) * Right.10:07:52
@sternenseemann:systemli.orgsterni (he/him) siraben: should probably read that, I basically just tested everything I said here :p 10:08:14
@siraben:matrix.orgsiraben (he/him)hehe10:08:54
@domenkozar:matrix.orgDomen KožarI've written about this here: https://nix.dev/anti-patterns/language#with-attrset-expression14:54:27
@andrew:mtx.rew.laandrew Is there any way I can evaluate the value of a variable at a specific point in a module? For example, I have environment.systemPackages = with pkgs; in my configuration.nix. Can I determine the value of pkgs at the point with pkgs;` is used? or do I need to analyze where pkgs is defined and reverse-calculate from there? 17:32:58
@sternenseemann:systemli.orgsterni (he/him)depends on what you need it for?18:03:16
@sternenseemann:systemli.orgsterni (he/him) if you are talking about editor-support then aaronjanse partially reimplemented the nix evaluator for that purpose https://github.com/aaronjanse/nix-eval-lsp 18:03:49
@sternenseemann:systemli.orgsterni (he/him)in general in your config pkgs is passed via a function argument to your configuration and comes from NIX_PATH in most cases18:04:30
@andrew:mtx.rew.laandrewI'm working on a project for nix. I'd like to be able to see the "dependencies" of each token recursively18:04:52
@andrew:mtx.rew.laandrewthis is a very interesting project18:05:21
@andrew:mtx.rew.laandrew(the one you linked)18:06:09
@andrew:mtx.rew.laandrew I was using rnix-parser like this project, but it seems this project has a complete implementation of what I was trying to build 18:09:49
@aaronjanse:matrix.orgaaronjanse andrew I'll look into exposing the functionality of nix-eval-lsp as a crate so that other people can use it 23:42:39
@andrew:mtx.rew.laandrew

hey aaronjanse thanks for your work! My primary need is recursively determining an expressions "dependencies". That is, how was pkgs in pkgs.gnome-terminal imported? is it really <nixpkgs>.gnome-terminal ? or is it <nixos-unstable>.gnome-terminal? Was pkgs changed prior to being referenced?

Do nix-eval-lsp or rnix-lsp provide the tools necessary to determine this? Or should I work based on rnix-parser?

23:47:28
@andrew:mtx.rew.laandrewIn short, considering all modules, determine which expressions changed the behavior of a given expression23:48:08
@andrew:mtx.rew.laandrew * In short, considering all imported modules, determine which expressions changed the behavior of a given expression23:48:18
@andrew:mtx.rew.laandrew * hey aaronjanse thanks for your work! My primary need is recursively determining an expressions "dependencies". That is, how was pkgs in pkgs.gnome-terminal imported? is it really <nixpkgs>.gnome-terminal ? or is it <nixos-unstable>.gnome-terminal? Was pkgs changed prior to being referenced? 23:48:31
@andrew:mtx.rew.laandrew Do nix-eval-lsp or rnix-lsp provide the tools necessary to determine this? Or should I work based on rnix-parser? 23:48:33
@andrew:mtx.rew.laandrew * In short, considering all imported modules (but ignoring <nixpkgs> / defaults), determine which expressions changed the behavior of a given expression23:49:30
@aaronjanse:matrix.orgaaronjanse andrew You could probably get most of the way with rnix-parser, but to understand things like `with pkgs` you might want something like nix-eval-lsp 23:52:09

Show newer messages


Back to Room ListRoom Version: 6