| 28 Sep 2021 |
@gytis-ivaskevicius:matrix.org | tho I doubt that eelco will approve such 'feature' due to it being impure | 12:40:34 |
@timdeh:matrix.org | How about a mechanism or perhaps a nix plugin that allows you to inject your own "call-flake.nix"? | 15:02:22 |
@gytis-ivaskevicius:matrix.org | this would equal injection of any kind of logic to inputs section which is supposed to be cheap to evaluate (according to eelco) | 15:29:44 |
@gytis-ivaskevicius:matrix.org | So we might as well disable the protection that currently stops us from defining logic there | 15:30:21 |
@gytis-ivaskevicius:matrix.org | To be fair inputs in toml file thingy is a solid solution here | 15:31:05 |
@gytis-ivaskevicius:matrix.org | but thats basically redesigning good chunk of existing flakes logic | 15:31:30 |
@timdeh:matrix.org | yeah, I dunno, having inputs in the flake.nix and the lock file is starting to get a little smelly for me, but maybe it's just the verbosity of the current implementation 😅 | 15:33:20 |
@timdeh:matrix.org | I'd say go ahead with a POC and maybe a PR and we'll see how it goes | 15:35:17 |
@gytis-ivaskevicius:matrix.org | Not sure what exactly was proposed in that unofficial roadmap but just now I played around with toml format and this is what I managed to define:
[github.NixOS.nixpkgs.release-21.05]
lastModified = 1632660378
narHash = 'sha256-sjA8eQlnyDjDLyAyq3XlJmN0nqW0ftl/pb7VnMg86L0='
owner = 'nixos'
repo = 'nixpkgs'
rev = '31ffc50c571e6683e9ecc9dbcbd4a8e9914b4497'
| 15:39:31 |
@gytis-ivaskevicius:matrix.org | Not perfect, also I am not sure how I feel about file being editable AND automagically modifiable | 15:40:19 |
@gytis-ivaskevicius:matrix.org | welp, and ofc once we have this we can perform whatever mapping logic using Nix | 15:41:09 |
@gytis-ivaskevicius:matrix.org | *lastModified should probably be in human readable format | 15:44:03 |
@gytis-ivaskevicius:matrix.org | hold on,im dumb. Forgot to remove 'owner' and 'repo' 😀 | 16:07:01 |
@gytis-ivaskevicius:matrix.org | * Not sure what exactly was proposed in that unofficial roadmap but just now I played around with toml format and this is what I managed to define:
[github.NixOS.nixpkgs.release-21.05]
lastModified = 1632660378
narHash = 'sha256-sjA8eQlnyDjDLyAyq3XlJmN0nqW0ftl/pb7VnMg86L0='
rev = '31ffc50c571e6683e9ecc9dbcbd4a8e9914b4497'
| 16:07:13 |
@gytis-ivaskevicius:matrix.org | * Not sure what exactly was proposed in that unofficial roadmap but just now I played around with toml format and this is what I managed to define:
[github.NixOS.nixpkgs.release-21.05]
lastModified = 1979-05-27T07:32:00-08:00
narHash = 'sha256-sjA8eQlnyDjDLyAyq3XlJmN0nqW0ftl/pb7VnMg86L0='
rev = '31ffc50c571e6683e9ecc9dbcbd4a8e9914b4497'
| 16:08:37 |
@gytis-ivaskevicius:matrix.org | Ah, there is another issue with this toml | 16:10:24 |
@gytis-ivaskevicius:matrix.org | there is no way to define custom arguments like dir | 16:10:38 |
yusdacra | In reply to @gytis-ivaskevicius:matrix.org Not perfect, also I am not sure how I feel about file being editable AND automagically modifiable Isn't the point of a lockfile to not be modified? | 16:24:16 |
yusdacra | In reply to @gytis-ivaskevicius:matrix.org Not perfect, also I am not sure how I feel about file being editable AND automagically modifiable * Isn't the point of a lockfile to not be modified manually? | 16:24:52 |
@gytis-ivaskevicius:matrix.org | what we are thinking of is not just a lockfile | 16:25:04 |
@gytis-ivaskevicius:matrix.org | a file that would act as a lockfile AND inputs definition | 16:25:16 |
@gytis-ivaskevicius:matrix.org | so you could avoid defining inputs in flake.nix | 16:25:27 |
@gytis-ivaskevicius:matrix.org | and the whole avoidance of defining inputs in flake.nix is due to its limitations | 16:26:00 |
yusdacra | Ah so basically to avoid redefining inputs in both places | 16:29:06 |
yusdacra | That sounds like it'd be interesting | 16:29:39 |
yusdacra | How would you "lock" an input to a certain revision in the example TOML? With flake.nix you can specify the revision in flake.nix and it will be locked, but if you change the rev field here doing a nix flake update would still update it right? | 16:31:43 |
yusdacra | * How would you lock an input to a certain revision in the example TOML? With flake.nix you can specify the revision in flake.nix and it will be locked, but if you change the rev field here doing a nix flake update would still update it right? | 16:31:51 |
@timdeh:matrix.org | I was imagining that the inputs in flake.nix are kinda redundant and that cli args could just as easily and remove and modify the lock file directly. So instead of inputs.someflake.url = "github:yada/yada" in the flake.nix you could do something like `nix flake add someflake github:yara/yada" | 17:59:41 |
@timdeh:matrix.org | * I was imagining that the inputs in flake.nix are kinda redundant and that cli args could just as easily add, remove and modify the lock file directly. So instead of inputs.someflake.url = "github:yada/yada" in the flake.nix you could do something like `nix flake add someflake github:yara/yada" | 17:59:56 |
@timdeh:matrix.org | * I was imagining that the inputs in flake.nix are kinda redundant and that cli args could just as easily add, remove and modify the lock file directly. So instead of inputs.someflake.url = "github:yada/yada" in the flake.nix you could do something like nix flake add someflake github:yara/yada" | 18:00:05 |