!SgYlXivkogarTVcnZO:nixos.org

Nix Flakes

897 Members
184 Servers

Load older messages


SenderMessageTime
15 Feb 2025
@benjb83:matrix.orgBenjB83 changed their display name from Benjamín Buske to BenjB83.10:43:25
16 Feb 2025
@kristijan.zic:matrix.orgKristijanZic joined the room.01:03:09
@steeringwheelrules:tchncs.de@steeringwheelrules:tchncs.de joined the room.15:47:13
18 Feb 2025
@stites:matrix.org@stites:matrix.org left the room.12:55:08
19 Feb 2025
@sss:matrix.dark-alexandr.netsss 20:06:14
20 Feb 2025
@winston:milli.ng@winston:milli.ng left the room.16:52:20
21 Feb 2025
@2kool4idkwhat:matrix.org@2kool4idkwhat:matrix.org joined the room.19:15:27
25 Feb 2025
@me:tk.runtk changed their profile picture.00:30:50
28 Feb 2025
@gladtherescake:matrix.gladtherescake.euLillian Violet (She/Fae) joined the room.16:32:26
1 Mar 2025
@melusine:wired.rehabMélusine joined the room.00:26:38
@cleverca22:matrix.orgcleverca22 is there a way to get the local path of the flake from within the flake? i was using toString ./. but now that its a flake, thats pointing off into the store 11:06:30
@elikoga:matrix.orgelikogainputs.self?11:06:53
@elikoga:matrix.orgelikoga Ah wait local path, no not possible. Since it's pure. 11:07:12
@elikoga:matrix.orgelikoga If you were able you would be able to smuggle information into the evaluation process 11:07:43
@elikoga:matrix.orgelikoga Why do you want to access that string? 11:08:07
@cleverca22:matrix.orgcleverca22
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:matrix.orgelikoga 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:matrix.orgcleverca22ah yes, that sounds perfect11:56:48
@cleverca22:matrix.orgcleverca22i'm also using direnv, so you cant run it from outside the repo11:57:19
@cleverca22:matrix.orgcleverca22the shell would unload all of those utils11:57:24
@cleverca22:matrix.orgcleverca22
       error: attribute 'self' missing
           22|     _module.args = {
           23|       inherit (flake) inputs self;
             |                              ^
           24|     };
12:01:32
@cleverca22:matrix.orgcleverca22now that just leaves this puzzle, it was working earlier12:01:40
@elikoga:matrix.orgelikoga I do not know inherit (flake) I've never met this man in my life 12:02:34
@elikoga:matrix.orgelikoga Also self is in inputs 12:02:49
@cleverca22:matrix.orgcleverca22
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:matrix.orgcleverca22i think i just want flake.outputs12:03:55
@elikoga:matrix.orgelikoga I think you have access from the inside 12:04:04
@elikoga:matrix.orgelikoga From the outside you can just toString getFlake to get the path I think 12:04:25
@cleverca22:matrix.orgcleverca22in this case, i want one of the outputs on the flake12:04:41
@cleverca22:matrix.orgcleverca22 x.outputs.packages.x86_64-linux.netinstall_image so yeah, i just want outputs 12:05:00

Show newer messages


Back to Room ListRoom Version: 6