| 8 Jun 2021 |
andrew | unsafeGetAttrPos seems very useful | 00:20:19 |
aaronjanse | In reply to @andrew:mtx.rew.la hmm, didn't rnix-lsp already have goodies built in to determine where, for example, pkgs in with pkgs; came from? Are you sure you need to know where it came from? | 00:20:23 |
aaronjanse | It might make sense to start off trying to do as much as possible with unsafeGetAttrPos | 00:20:53 |
aaronjanse | Huh or maybe start off by just visualizing the output of pkgs.lib.nixosSystem (which should list the values of all nixos options) | 00:21:55 |
aaronjanse | * Huh or maybe start off by just visualizing the output of pkgs.lib.nixosSystem { ... } (which should list the values of all nixos options for your system) | 00:22:17 |
andrew | I'm probably getting ahead of myself, but it would be useful for users to be able to modify things like let-in statements. E.g. observe that python3Packages comes from a let-in statement, then examine the expression defining python3Packages, examine which options depend on it, then understand properly whether python3Packages should be upgraded from 37 to 39 | 00:22:36 |
aaronjanse | Hmm, would they do this in an IDE like vscode, or would they use something like the UI you send a screenshot of above? | 00:25:29 |
andrew | Ideally this works for noobs, but has the capability for more advanced changes | 00:25:57 |
aaronjanse | If the latter, maybe you could combine {nix-instantiate with unsafeGetAttrPos} with rnix-lsp | 00:26:21 |
aaronjanse | That way you know the fully evaluated system then can do insights (using rnix-lsp) on the code that nix-instantiate points you to | 00:26:58 |
andrew | what does unsafeGetAttrPos provide which I can't get from rnix-lsp? | 00:27:20 |
aaronjanse | Oh it just lets you do operations on evaluated expressions. And I assume you'll want to evaluate the configuration.nix to figure out what the current nixos option values are and where they're defined? | 00:28:30 |
andrew | well I'm not sure I ever want the evaluated option values. Just a form representation of the "raw" option | 00:29:09 |
aaronjanse | Oh got it | 00:29:32 |
andrew | although seeing the incrementally evaluated form of an option could be useful while editing | 00:30:01 |
aaronjanse | I guess you'd want the value to know whether the "enabled" checkbox should be checked for a given option | 00:31:29 |
aaronjanse | But you've thought through this more than I have | 00:31:39 |
aaronjanse | * But you've thought this through more than I have | 00:34:03 |
andrew | Right now I just record the current system state in json via nix-build /etc/nixos/nixpkgs/nixos/release.nix -A options -o release_out and nixos-option, however because this requires evaluating the expression it works for things like checkboxes which generally are defined with basic expressions (true / false rather than a function). | 00:35:17 |
andrew | more complicated solutions come in when it's defined by a variable or an attribute within a variable (excuse my likely wrong terminology) | 00:36:07 |
aaronjanse | Yeah no problem | 00:36:49 |
Buckley | does nix language have an equivelant to haskell's $ operator for reducing parenthases? | 05:45:51 |
Buckley | i haven't seen one yet, but just checking 😇 | 05:47:02 |
aaronjanse | Buckley I don't think it does | 06:15:05 |
| Jez (he/him) changed their profile picture. | 08:53:59 |
| Jez (he/him) changed their profile picture. | 09:42:56 |
| davidtwco joined the room. | 10:01:35 |
| artturin joined the room. | 17:24:10 |
emily | Buckley: no, but you can do e.g. pipe x [ f g h ] for f (g (h x)) | 21:17:48 |
emily | still need parens if f, g or h are themselves function applications (e.g. for passing multiple arguments) | 21:17:59 |