-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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: Don't Require a system Suffix #5256
Comments
Not including the system type is incompatible with hermetic evaluation, since it means that evaluating an attribute like |
Would it be possible to do some kind of auto-expansion? Eg: if |
What if we had a primop that behaves as follows but memoizes its result: functionPath: argPaths: import functionPath (mapAttrs import argPaths) This doesn't correspond neatly to flakes, but is more powerful. Wouldn't we be able to create a
No helper lib required, no unnecessary By giving the memoization to users, we can also experiment with cross compilation in flakes, which doesn't seem to have been a consideration in the flake design yet. (Apologies if I sound repetitive; couldn't find my earlier comment) |
Can't flakes have functions as output? Then you can already fall back to just providing the function (System -> ...) itself? |
@xaverdh, yes they can. Such a fallback doesn't scale though. The ecosystem is already referencing
Haven't found the comment, but this is basically a duplicate of #3843. |
I marked this as stale due to inactivity. → More info |
I'd make this problem top priority. Flakes should natively support both This is part of the domain, and by neglecting it, we are confusing users and creating a sprawl of helper functions. |
I recently discussed this with @roberth after implementing #12426. Another concept of implementation is with adding {
system = "aarch64-linux";
cc = "gcc";
libc = "musl";
pageSize = {
min = 4096;
max = 16384;
};
} This would then get passed to nixpkgs's I'm thinking it might be good to gather 2 or 3 concepts and discuss them among the Nix team, come together with an RFC and work things through there. From the RFC would come the full implementation. |
Many packages are agnostic to system, toolchain, ABI, etc, so it would be beneficial to support flake authors to pass such information along to Nixpkgs and other flakes with little effort. By using a function, it is easy to pass all this configuration to another input's configuring function. |
I'm not sure if an issue is the right place for this discussion.
If not, please feel free to close and direct me to a better venue.
Problem
The current structure of flakes, with derivations in a hierarchy that includes the system, is pretty annoying to use.
It basically mandates using a helper library like
flake-utils
It adds complexity to an already complex system, and makes writing flakes more awkward.
It also introduces relatively confusing error messages.
Most packages will be the same across systems, with potentially only small modifications.
Solutions
I think optimising developer experience for the common case is important.
I suggest:
That retains the flexibility of the current approach, but doesn't introduce the additional burden when not required.
The text was updated successfully, but these errors were encountered: