Skip to content

Conversation

@quantenzitrone
Copy link

Rendered

Sorry if the RFC text is short, i don't know what else to write. The feature is quite simple.

@robsliwi
Copy link

Related: NixOS/nixpkgs#421201

Comment on lines +59 to +63
- Every attrName in the resulting attribute set has to be a valid package
attribute name.
- Every attrValue should be the pinned version of the respectice attrName
package, this is however hard to check I think.
- Every attrName has to be a functionArg of the `package.nix`.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this is out of scope, but can we also pin dependencies that not just differ in their semantic versions like nodejs = nodejs_22, but have other overrides or logic?
Some example pins.nix:

{
  darwin,
  stdenv,
}@args:
{
  stdenv = if args.stdenv.hostPlatform.isDarwin then darwin.bootstrapStdenv else args.stdenv;
}
{
  luajit,
}@args:
{
  luajit = args.luajit.override { enable52Compat = true; };
}

This would be useful to keep compatibility with previous overrides of a package when removing by-name overrides.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think we lose some of the usefulness if we allow that
also like with version pins we can already do that just in the package.nix with let in

lists the problem this RFC is trying to solve under "Future work".

# Unresolved questions
[unresolved]: #unresolved-questions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When overriding a package, will it override the the arguments of pins.nix or the arguments of package.nix?
Perhaps it could override package.nix and we could have an overridePins function.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.override {} overrides the package.nix
why would someone need to override the pins?

package.overridePins {
  dependency_3 = my-dependency_3;
}

would be the same as

package.override {
  dependency = my-dependency_3;
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there is an ambiguity here. Overrides relative to callPackage path/to/package.nix {} are not provided at all, because this would break more than help (and also override works relative to a package that is defined, and the package defined does use pins). You can just override all the pinned stuff one-by-one, though, if for some specific package it makes sense.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry, i don't understand what you are trying to say

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants