Skip to content

Commit

Permalink
Fill version in nix run
Browse files Browse the repository at this point in the history
  • Loading branch information
kachick committed Apr 25, 2024
1 parent 2d97d86 commit b88e94b
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
let
pkgs = nixpkgs.legacyPackages.${system};
edge-pkgs = edge-nixpkgs.legacyPackages.${system};
updaterVersion = if (self ? shortRev) then self.shortRev else "dev";
in
rec {
formatter = edge-pkgs.nixfmt-rfc-style;
Expand All @@ -43,10 +42,14 @@
];
};

packages.selfup = edge-pkgs.buildGo122Module {
packages.selfup = edge-pkgs.buildGo122Module rec {
pname = "selfup";
version = updaterVersion;
src = pkgs.lib.cleanSource self;
version = "v1.1.1";
ldflags = [
"-X main.version=${version}"
"-X main.commit=${if (self ? rev) then self.rev else "0000000000000000000000000000000000000000"}"
];

# When updating go.mod or go.sum, update this sha together as following
# vendorHash = "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=";
Expand Down

0 comments on commit b88e94b

Please sign in to comment.