Skip to content

Commit

Permalink
Merge pull request #8 from numtide/chore/set-package-version
Browse files Browse the repository at this point in the history
feat: set nix package version to shortRev
  • Loading branch information
brianmcgee committed May 10, 2024
2 parents 0dd4344 + 9b00e00 commit 2188358
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions nix/packages.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
{inputs, ...}: {
{
self,
inputs,
...
}: {
imports = [
inputs.flake-parts.flakeModules.easyOverlay
];
Expand All @@ -13,7 +17,9 @@
packages = rec {
treefmt = inputs'.gomod2nix.legacyPackages.buildGoApplication rec {
pname = "treefmt";
version = "2.0.0+dev";
# there's no good way of tying in the version to a git tag or branch
# so for simplicity's sake we set the version as the commit revision hash
version = self.shortRev or self.dirtyShortRev;

# ensure we are using the same version of go to build with
inherit (pkgs) go;
Expand All @@ -36,6 +42,8 @@

modules = ../gomod2nix.toml;

CGO_ENABLED = 1;

ldflags = [
"-s"
"-w"
Expand Down

0 comments on commit 2188358

Please sign in to comment.