-
Notifications
You must be signed in to change notification settings - Fork 106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Flakes: add system-independent outputs? #290
Comments
Thanks for that. I'm not using mach-nix much with flakes for myself. Your input is useful. Concerning the import arguments which are unpractical to use for flake users:
The next question which arises, do we want to keep the API downward compatible or not? I vote for no, to reduce the amount of possible ways to call mach-nix. |
I bet that there isn't a convention. The flakes feature of nix is in experimental status. Everything could still be changed in a way that is not backward compatible. Also the |
Yes, I'd love to prepare a PR,
Oh, I wonder if the conflicts I reported in the other issue may be due to this... P.S. My fingers seem to autocomplete system to systemd whenever something breaks... |
I poked about moving the On a meta-level, it doesn't look very compositional that the user is constrained to pin |
Yep, that check will only work with the flakes of nixpkgs. We could just remove/ignore it for the overlay.
It is not constrained to be below the mach-nix nixpkgs. It should just be older than the |
As far as I know an "appropriate" flakes interface for mach-nix is still more or less an open question, and it has already been discussed in: #153
As a resolution of that discussion, the
mk(Python|...)
functions have been added aslib.mk...
flake outputs, which made them, well, accessible in the importing flakes.However, those functions are currently extracted from
default-mach-nix
which has already been populated with a concrete version ofnixpkgs
, imported in alet in
statement inmach-nix
'sflake.nix
. This means that one can't pass those functions their own version ofnixpkgs
(e.g.final
orprev
in an overlay) without re-importingmach-nix
manually as a non-flake.One resolution could be to make
lib
functions system-independent (I thought they are, by-convention, supposed to be, but I'm not sure and I can't find references for that)The other (and probably optimal, at the moment) resolution would be to provide a flake
.overlay
output, which would be a functionfinal: prev:
adding amach-nix
attrset tonixpkgs
possessing all the appropriate functions. and derivations. If I understand correctly, this is whatpoetry2nix
does.P.S. I'm unsure, again, if it's a convention, but I saw in some repos that with an
overlay
output it might be convenient to refactorpackages
offlake.nix
to just inherit the respective outputs frompkgs
, wherepkgs
would be imported with this exact overlay. Thus we'd have a system-independentoverlay
output and thepackages
that refer tonixpkgs
version pinned in theflake.lock
, addressing the questions raised in the previous issue in a rather un-confusing wayP.P.S. I still don't know anything about whether
pypy-deps-db
andnixpkgs
versions need to be matched in any way. E.g. if one uses a mach-nix overlay on their own revision of nixpkgs, would they ever need to pass a custompypy-deps-db
too? Should we makepypy-deps-db
an argument of something, or perhaps pass it through thepkgs
as well, so as to leave an option to override it in another overlay?The text was updated successfully, but these errors were encountered: