mirror of
https://github.com/numtide/treefmt.git
synced 2024-10-27 01:44:13 +03:00
feat: set nix package version to shortRev
Signed-off-by: Brian McGee <brian@bmcgee.ie>
This commit is contained in:
parent
0dd4344339
commit
9b00e00666
@ -1,4 +1,8 @@
|
|||||||
{inputs, ...}: {
|
{
|
||||||
|
self,
|
||||||
|
inputs,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
imports = [
|
imports = [
|
||||||
inputs.flake-parts.flakeModules.easyOverlay
|
inputs.flake-parts.flakeModules.easyOverlay
|
||||||
];
|
];
|
||||||
@ -13,7 +17,9 @@
|
|||||||
packages = rec {
|
packages = rec {
|
||||||
treefmt = inputs'.gomod2nix.legacyPackages.buildGoApplication rec {
|
treefmt = inputs'.gomod2nix.legacyPackages.buildGoApplication rec {
|
||||||
pname = "treefmt";
|
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
|
# ensure we are using the same version of go to build with
|
||||||
inherit (pkgs) go;
|
inherit (pkgs) go;
|
||||||
@ -36,6 +42,8 @@
|
|||||||
|
|
||||||
modules = ../gomod2nix.toml;
|
modules = ../gomod2nix.toml;
|
||||||
|
|
||||||
|
CGO_ENABLED = 1;
|
||||||
|
|
||||||
ldflags = [
|
ldflags = [
|
||||||
"-s"
|
"-s"
|
||||||
"-w"
|
"-w"
|
||||||
|
Loading…
Reference in New Issue
Block a user