gytis-ivaskevicius/flake-utils-plus

Get rid of saneFlakeDefaults

gytis-ivaskevicius opened this issue ยท 8 comments

https://github.com/gytis-ivaskevicius/flake-utils-plus/blob/master/modules/saneFlakeDefaults.nix#L1-L18

Another little thing to simplify implementation for end users.
What needs to be done:

  • Make sure that everything is easily overwritable
  • Make sure that it does not conflict with non-nixos systems

Also, I notice that we have this logic duplication ๐Ÿค”
https://github.com/gytis-ivaskevicius/flake-utils-plus/blob/staging/src/systemFlake.nix#L157
https://github.com/gytis-ivaskevicius/flake-utils-plus/blob/master/modules/saneFlakeDefaults.nix#L15

Related:
#60

Not a huge fan of the auto-creating registry. It makes it so inputs are locked to paths in your nix store making flakes less reproducible. If you commit a lock file like that, others can't make use of it. Maybe a prefix/suffix could be added to all he registry entries, so they don't affect lock files.

I feel like that's just a misusage of flakes that you are talking about ๐Ÿค” Pretty much anything can be misused.
I guess if you'd like an option to enable auto registry could be created?

Not really, if your registry contains a an entry that links utils to /nix/store/abc then the next time you use your flake, the lock file will get its utils entry update to /nix/store/abc. When you share that flake with someone else, they won't be able to use it since they might not yet have downloaded /nix/store/abc. I've actually tried this before, nix give an error while going through the lock file.

I don't see any misuse here, you just build a flake with fup and then run a nix flake command on that flake and the issue occurs.

The only case that it links to a path is if flake input is not defined. Or at least that's the only one I am aware of?

If that really is the only case - is this really an issue? ๐Ÿค”

Well yeah its specifically an issue for something like nixpkgs, where its pretty common to just get nixpkgs as an argument without defining the flake. But thats still a problem if its fairly likely for someone's nixpkgs input to not be reproducible. Maybe we could filter out nixpkgs, since thats probably the only case where teh issue would happen. But as more entries get added to the flake registry, it would become worse of an issue.

To me, it sounds like it should be an opt-in feature (an option that the user should enable)
I'd hate to wait for a flake to get queried (especially one as big as nixpkgs) and then wait for dependencies to get downloaded that are not cached on my system

Yeah agreed, opt-in is fine. I just wanted to share issues I've had with it. Its definitely a useful feature though.

Resolved in staging