| 7 Jun 2021 |
sterni (he/him) | You can determine { foo }: let inherit (foo) a; in a lexically | 10:06:46 |
siraben (he/him) | * oh well x in with x; e is not syntax here | 10:06:46 |
sterni (he/him) | but { foo }: with foo; a not | 10:06:57 |
siraben (he/him) | Right. | 10:07:01 |
siraben (he/him) | So it actually makes sense then heh | 10:07:09 |
siraben (he/him) | weird | 10:07:11 |
sterni (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 |
sterni (he/him) | where the set is hard coded in place essentially | 10:07:41 |
siraben (he/him) | I think the thesis gives a desugaring step for with constructs | 10:07:45 |
siraben (he/him) | RIght. | 10:07:49 |
siraben (he/him) | * Right. | 10:07:52 |
sterni (he/him) | siraben: should probably read that, I basically just tested everything I said here :p | 10:08:14 |
siraben (he/him) | hehe | 10:08:54 |
Domen Kožar | I've written about this here: https://nix.dev/anti-patterns/language#with-attrset-expression | 14:54:27 |
andrew | 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 |
sterni (he/him) | depends on what you need it for? | 18:03:16 |
sterni (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 |
sterni (he/him) | in general in your config pkgs is passed via a function argument to your configuration and comes from NIX_PATH in most cases | 18:04:30 |
andrew | I'm working on a project for nix. I'd like to be able to see the "dependencies" of each token recursively | 18:04:52 |
andrew | this is a very interesting project | 18:05:21 |
andrew | (the one you linked) | 18:06:09 |
andrew | 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 | 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 | 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 | In short, considering all modules, determine which expressions changed the behavior of a given expression | 23:48:08 |
andrew | * In short, considering all imported modules, determine which expressions changed the behavior of a given expression | 23:48:18 |
andrew | * 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 | 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 | * In short, considering all imported modules (but ignoring <nixpkgs> / defaults), determine which expressions changed the behavior of a given expression | 23:49:30 |
aaronjanse | 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 |