mirror of
https://github.com/juanfont/headscale.git
synced 2024-11-30 02:43:05 +00:00
set version based on git rev
This commit is contained in:
parent
11ccae8e52
commit
06d85688fd
1 changed files with 5 additions and 2 deletions
|
@ -7,6 +7,9 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = { self, nixpkgs, flake-utils, ... }:
|
outputs = { self, nixpkgs, flake-utils, ... }:
|
||||||
|
let
|
||||||
|
headscaleVersion = if (self ? shortRev) then self.shortRev else "dev";
|
||||||
|
in
|
||||||
{
|
{
|
||||||
overlay = final: prev:
|
overlay = final: prev:
|
||||||
let
|
let
|
||||||
|
@ -52,7 +55,7 @@
|
||||||
headscale =
|
headscale =
|
||||||
pkgs.buildGo117Module rec {
|
pkgs.buildGo117Module rec {
|
||||||
pname = "headscale";
|
pname = "headscale";
|
||||||
version = "dev";
|
version = headscaleVersion;
|
||||||
src = pkgs.lib.cleanSource self;
|
src = pkgs.lib.cleanSource self;
|
||||||
|
|
||||||
# When updating go.mod or go.sum, a new sha will need to be calculated,
|
# When updating go.mod or go.sum, a new sha will need to be calculated,
|
||||||
|
@ -94,7 +97,7 @@
|
||||||
# docker load < result
|
# docker load < result
|
||||||
headscale-docker = pkgs.dockerTools.buildLayeredImage {
|
headscale-docker = pkgs.dockerTools.buildLayeredImage {
|
||||||
name = "headscale";
|
name = "headscale";
|
||||||
tag = "latest";
|
tag = headscaleVersion;
|
||||||
contents = [ pkgs.headscale ];
|
contents = [ pkgs.headscale ];
|
||||||
config.Entrypoint = [ (pkgs.headscale + "/bin/headscale") ];
|
config.Entrypoint = [ (pkgs.headscale + "/bin/headscale") ];
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue