!SgYlXivkogarTVcnZO:nixos.org

Nix Flakes

890 Members
179 Servers

Load older messages


SenderMessageTime
21 Nov 2021
@balsoft:balsoft.rubalsoft I didn't know you could even do imports in the home-manager nixos module :D 19:07:40
@balsoft:balsoft.rubalsoftApparently I'm some years behind on this19:07:55
@artemist:artem.istartemist 🏳️‍⚧️ Okay, got it. You need to set home-manager.extraSpecialArgs and I was setting home-manager.users.artemis.extraSpecialArgs 19:09:47
@tomberek:matrix.orgtomberek

What would people think of having a "arg" type for flake arguments. Imagine

{ 
inputs.someArg = { type = "arg"; default = "defaultValue"; description="A thing"; };
outputs = { self, someArg, ...
 }
nix build .#someOutput --someArg anotherValue
would be equivalent to
nix build .#someOutput --override-input someArg "arg://anotherValue"
and
nix flake metadata
Inputs:
---- someArg: arg://defaultValue
...

It can be achieved with a path or dedicated git repo right now, but that's almost too much redirection for simple values/parameters. eg: echo anotherValue > f; nix build .#someOutput --override-input someArg path:$PWD/f

22:47:45
22 Nov 2021
@cdepillabout:matrix.orgcdepillabout
In reply to @tomberek:matrix.org

What would people think of having a "arg" type for flake arguments. Imagine

{ 
inputs.someArg = { type = "arg"; default = "defaultValue"; description="A thing"; };
outputs = { self, someArg, ...
 }
nix build .#someOutput --someArg anotherValue
would be equivalent to
nix build .#someOutput --override-input someArg "arg://anotherValue"
and
nix flake metadata
Inputs:
---- someArg: arg://defaultValue
...

It can be achieved with a path or dedicated git repo right now, but that's almost too much redirection for simple values/parameters. eg: echo anotherValue > f; nix build .#someOutput --override-input someArg path:$PWD/f

That would be amazing. That's one of my big remaining issues with flakes: https://discourse.nixos.org/t/passing-options-to-flakes/7579
00:24:51
@cdepillabout:matrix.orgcdepillabout
In reply to @tomberek:matrix.org

What would people think of having a "arg" type for flake arguments. Imagine

{ 
inputs.someArg = { type = "arg"; default = "defaultValue"; description="A thing"; };
outputs = { self, someArg, ...
 }
nix build .#someOutput --someArg anotherValue
would be equivalent to
nix build .#someOutput --override-input someArg "arg://anotherValue"
and
nix flake metadata
Inputs:
---- someArg: arg://defaultValue
...

It can be achieved with a path or dedicated git repo right now, but that's almost too much redirection for simple values/parameters. eg: echo anotherValue > f; nix build .#someOutput --override-input someArg path:$PWD/f

* That would be amazing. Not being able to pass arguments one of my big remaining issues with flakes: https://discourse.nixos.org/t/passing-options-to-flakes/7579
00:25:31
@klaymore:klaymore.meklaymore joined the room.05:12:32
@klaymore:klaymore.meklaymore set a profile picture.05:15:16
@cdepillabout:matrix.orgcdepillabout * That would be amazing. Not being able to pass arguments is one of my big remaining issues with flakes: https://discourse.nixos.org/t/passing-options-to-flakes/7579 11:14:34
@roberthensing:matrix.orgRobert Hensing (roberth)
In reply to @tomberek:matrix.org

What would people think of having a "arg" type for flake arguments. Imagine

{ 
inputs.someArg = { type = "arg"; default = "defaultValue"; description="A thing"; };
outputs = { self, someArg, ...
 }
nix build .#someOutput --someArg anotherValue
would be equivalent to
nix build .#someOutput --override-input someArg "arg://anotherValue"
and
nix flake metadata
Inputs:
---- someArg: arg://defaultValue
...

It can be achieved with a path or dedicated git repo right now, but that's almost too much redirection for simple values/parameters. eg: echo anotherValue > f; nix build .#someOutput --override-input someArg path:$PWD/f

Add a self:// input and you can solve the system problem in a new and imho better way
16:37:57
@tomberek:matrix.orgtomberekI'll play with this idea a bit to see the pros/cons.16:48:51
23 Nov 2021
@server_stats:nordgedanken.devServer Stats Discoverer (traveler bot) left the room.02:59:33
@everything-narrative:matrix.orgKeel joined the room.08:44:44
@endomain:matrix.orgendomain joined the room.20:57:00
24 Nov 2021
@theophane:hufschmitt.netThéophane joined the room.12:30:41
@theophane:hufschmitt.netThéophane
In reply to @tomberek:matrix.org

What would people think of having a "arg" type for flake arguments. Imagine

{ 
inputs.someArg = { type = "arg"; default = "defaultValue"; description="A thing"; };
outputs = { self, someArg, ...
 }
nix build .#someOutput --someArg anotherValue
would be equivalent to
nix build .#someOutput --override-input someArg "arg://anotherValue"
and
nix flake metadata
Inputs:
---- someArg: arg://defaultValue
...

It can be achieved with a path or dedicated git repo right now, but that's almost too much redirection for simple values/parameters. eg: echo anotherValue > f; nix build .#someOutput --override-input someArg path:$PWD/f

I was actually looking at this old PR of mine, and I think this would be a very nice way to avoid the combinatorial explosion of available outputs
19:56:10
25 Nov 2021
@betaboon:0x80.ninjabetaboon is it possible to have multiple flake.nix within the same repo, eg in a monorepo-scenario? 13:10:13
@j-k:matrix.orgj-kyou can have separate flakes in subdirs. I imagine you could have a flake at the top that imports them all too but I've not seen it or tried it13:18:49
@mewp:nurupo.plmewp I don't think you would be able to use import at the top of a flake 13:31:06
@mewp:nurupo.plmewpyou can have them as inputs though13:31:13
@theophane:hufschmitt.netThéophane It’s possible to have inputs.otherFlake.url = "path:./subdir";. The only (but painful) issue is that you’ll need to run nix flake lock --update-input otherFlake everytime you modify subdir for the changes to be taken into account 13:33:30
@theophane:hufschmitt.netThéophane (Alternatively always passing --override-input otherFlake ./subdir probably works too, but equally as invasive) 13:34:25
@betaboon:0x80.ninjabetaboonthanks for your input :)13:50:47
@j-k:matrix.orgj-kyeah I meant inputs14:36:53
@betaboon:0x80.ninjabetaboonis it possible yet to define a binary-cache to use in a flake.nix? iirc that somehow worked but not on multi-user systems ?17:48:26
@theophane:hufschmitt.netThéophane
In reply to @betaboon:0x80.ninja
is it possible yet to define a binary-cache to use in a flake.nix? iirc that somehow worked but not on multi-user systems ?
It should work in the latest master, but not in 2.4
17:49:58
@betaboon:0x80.ninjabetabooni think i found the PR: https://github.com/NixOS/nix/pull/5504 right?17:50:25
@betaboon:0x80.ninjabetaboonthanks for letting me know. just had to revert to 2.4 earlier today tho, due to https://github.com/NixOS/nix/issues/561617:52:29
@uakci:uakci.pluakci~ joined the room.20:41:49
26 Nov 2021
@pinpox:matrix.orgpinpox joined the room.16:09:00

Show newer messages


Back to Room ListRoom Version: 6