Skip to content

Conversation

@ShamrockLee
Copy link
Contributor

Things done

This PR makes it possible to override the version attribute of package ollama using buildGoModule's newly-added fixed-point arguments (finalAttrs: { }) support.

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 25.05 Release Notes (or backporting 24.11 and 25.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@github-actions github-actions bot added 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. labels Apr 21, 2025
Copy link
Contributor

@abysssol abysssol left a comment

Choose a reason for hiding this comment

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

I don't understand why a fixed point function is being used as opposed to simply adding a version argument to the package. I don't even understand how this would actually be used to change the version. A package argument could be changed with override or callPackage; how would this be used?

@drupol
Copy link
Contributor

drupol commented Apr 21, 2025

I don't understand why a fixed point function is being used as opposed to simply adding a version argument to the package.

AFAIK, there are multiple reasons:

  1. This is a not a practice adopted widely in nixpkgs
  2. Adding a parameter will require adding one (or multiple) hash parameters too

I don't even understand how this would actually be used to change the version. A package argument could be changed with override or callPackage; how would this be used?

It would be used as such:

ollama' = ollama.overrideAttrs (oldAttrs: {
  # Change what you want in here, and you have access to the current attributes through `oldAttrs` if needed.
});

@prusnak prusnak force-pushed the ollama-finalAttrs-version branch from 87eb609 to a31997a Compare April 21, 2025 19:12
@github-actions github-actions bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. and removed 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. labels Apr 21, 2025
@prusnak prusnak merged commit d591dd4 into NixOS:master Apr 21, 2025
24 of 27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants