| 1 Mar 2025 |
elikoga | inputs.self? | 11:06:53 |
elikoga | Ah wait local path, no not possible. Since it's pure. | 11:07:12 |
elikoga | If you were able you would be able to smuggle information into the evaluation process | 11:07:43 |
elikoga | Why do you want to access that string? | 11:08:07 |
cleverca22 | In reply to @elikoga:matrix.org Why do you want to access that string? i need the path to something in the working tree, to pass to a util i'm running in a shell i dont want to have to re-load the shell every single time things get modified, thats already caused bugs because this wasnt noticed
i could use the working directory, but then it will fail if you cd into the wrong sub-dir
| 11:54:07 |
elikoga | I use git rev-parse --show-toplevel in a shellHook in the dev shell and if you run it from outside the repo that's on you | 11:55:42 |
cleverca22 | ah yes, that sounds perfect | 11:56:48 |
cleverca22 | i'm also using direnv, so you cant run it from outside the repo | 11:57:19 |
cleverca22 | the shell would unload all of those utils | 11:57:24 |
cleverca22 | error: attribute 'self' missing
22| _module.args = {
23| inherit (flake) inputs self;
| ^
24| };
| 12:01:32 |
cleverca22 | now that just leaves this puzzle, it was working earlier | 12:01:40 |
elikoga | I do not know inherit (flake) I've never met this man in my life | 12:02:34 |
elikoga | Also self is in inputs | 12:02:49 |
cleverca22 | nix-repl> x = builtins.getFlake (toString ./.);
nix-repl> x.inputs.self
error:
… while evaluating the attribute 'inputs.self'
at «nix-internal»/call-flake.nix:78:23:
77|
78| inherit inputs; inherit outputs; inherit sourceInfo; _type = "flake";
| ^
79| };
error: attribute 'self' missing
at «string»:1:1:
1| x.inputs.self
| ^
| 12:03:14 |
cleverca22 | i think i just want flake.outputs | 12:03:55 |
elikoga | I think you have access from the inside | 12:04:04 |
elikoga | From the outside you can just toString getFlake to get the path I think | 12:04:25 |
cleverca22 | in this case, i want one of the outputs on the flake | 12:04:41 |
cleverca22 | x.outputs.packages.x86_64-linux.netinstall_image so yeah, i just want outputs | 12:05:00 |
| 2 Mar 2025 |
| Heitor Augusto joined the room. | 22:58:16 |
| 3 Mar 2025 |
| bendanm joined the room. | 04:43:17 |
| vog joined the room. | 10:24:09 |
| 6 Mar 2025 |
| solomon joined the room. | 00:12:18 |
solomon | Hi. is there any way to have nested package outputs like this?
packages = {
foo = pkgs.foo;
bar = {
baz = pkgs.baz;
qux = pkgs.qux;
};
};
| 00:15:10 |
solomon | so that you can do something like nix build '.#bar.baz' | 00:15:28 |
solomon | I thought flake-utils' flattenTree would do this but it doesnt seem to | 00:18:23 |
solomon | * I thought flake-utils' flattenTree would allow this but it doesnt seem to | 00:18:30 |
elikoga | I think you can place them in the root of the flake outputs | 00:19:01 |
solomon | what do you mean? | 00:19:16 |
elikoga | Right now you're trying to use shorthand package selection syntax but it probably fails due to there not being an architecture | 00:19:27 |