nmattia / niv

Easy dependency management for Nix projects
https://github.com/nmattia/niv
MIT License
1.62k stars 79 forks source link

Handle tagged releases #141

Open zimbatm opened 5 years ago

zimbatm commented 5 years ago

It happened a few times where I wanted not to follow a branch but releases.

Ideally I could say something like:

niv add draganm/terraform-providers-linuxbox --release

And then niv would look at the tagged releases instead. A version attribute would be added to source so I can then do something like this:

let
  src = (import ./nix/sources.nix).terraform-provider-linuxbox;
in
buildGoPackage {
  pname = "terraform-provider-linuxbox";
  version = src.version;
  inherit src;
}
PierreR commented 5 years ago

why not offer the ability to pass the tag directly ?

niv add draganm/terraform-providers-linuxbox --release v1.0.0
zimbatm commented 5 years ago

The current workaround is to use the --branch v1.0.0 argument as it's using any git ref under the hood. Then on the nix side, remove the v prefix from the source branch attribute to extract the version.

The downside is that updates are manual as niv update would pull from the same tag.

nmattia commented 4 years ago

@zimbatm I fixed the handling of tag and branch attributes for git sources (https://github.com/nmattia/niv/pull/268). I think it's time to think about tagged releases. Can you clarify what you have in mind?

ldeck commented 1 year ago

How about just specifying --tag instead of --branch when adding/updating/modifying a package? Bonus points (i.e., a subsequent feature, if useful) would be providing a version update rule for tagged releases.