Skip to content
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

pkgs: automatic source management #135

Merged
merged 3 commits into from
Feb 26, 2021
Merged

pkgs: automatic source management #135

merged 3 commits into from
Feb 26, 2021

Conversation

nrdxp
Copy link
Collaborator

@nrdxp nrdxp commented Feb 23, 2021

Fixes #118.

  • Leverage flakes to manage package sources & hashes
  • Update documentation with an example.
  • Add mkVersion function to autogenerate a version string
  • Add srcs package via overlay containing all sources defined in pkgs/flake.nix
  • Extend flk update with the ability to only update the given input
  • Fix flake-compat support

Would appreciate any feedback before finalizing.

My only nitpick is that I'd love to add the ability for mkVersion to pull a flake urls ref if one is given. For example, a flake url "github:owner/repo/version-tag" would generate the version: "version-tag". Doesn't seem like flake inputs keep the original ref though, only the sha, so we can't do this without parsing the lock file, or potentially filing an issue upstream to include this information.

Note:

This will break hercules-ci, since it currently relies on flake-compat, and this technique breaks flake-compat. So I'm kinda hesitant to merge unless a workaround is found.

/cc @benneti @blaggacao @Pacman99

@blaggacao
Copy link
Contributor

blaggacao commented Feb 23, 2021

Doesn't seem like flake inputs keep the original ref though, only the sha, so we can't do this without parsing the lock file, or potentially filing an issue upstream to include this information.

NixOS/nix#3838

I was never sold on @edolstra 's counter argument, but this PR might count as one interesting use case.

@nrdxp nrdxp mentioned this pull request Feb 23, 2021
17 tasks
@nrdxp nrdxp changed the title pkgs: use subflake for sources pkgs: aoutmatic source management Feb 26, 2021
@nrdxp nrdxp changed the title pkgs: aoutmatic source management pkgs: automatic source management Feb 26, 2021
@nrdxp nrdxp force-pushed the auto-srcs branch 2 times, most recently from 472ea9c to d3c07eb Compare February 26, 2021 06:59
* Resolves #118
* Leverage flakes to manage package sources & hashes
* Update documentation with an example.
* Add `mkVersion` function to autogenerate a version string.
* Add srcs package via overlay containing all sources defined in
  _pkgs/flake.nix_
* Extend `flk update` with the ability to only update the given input
@nrdxp nrdxp merged commit afedb53 into core Feb 26, 2021
@nrdxp nrdxp deleted the auto-srcs branch March 2, 2021 02:21
@blaggacao
Copy link
Contributor

Works perfect except for vendorSha256 shenanigans. I was never a fan of that construct and wonder why I'm supposed not to trust the chain of git commit -> go.sum lockfile shas.

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.

semi automatic update for /pkgs
2 participants