mirror of
https://github.com/fosrl/newt.git
synced 2026-02-08 05:56:40 +00:00
fix(nix): replace version string sub with ldflags, use gitignore on src
This commit is contained in:
19
flake.nix
19
flake.nix
@@ -25,22 +25,21 @@
|
||||
|
||||
# Update version when releasing
|
||||
version = "1.4.2";
|
||||
|
||||
# Update the version in a new source tree
|
||||
srcWithReplacedVersion = pkgs.runCommand "newt-src-with-version" { } ''
|
||||
cp -r ${./.} $out
|
||||
chmod -R +w $out
|
||||
rm -rf $out/.git $out/result $out/.envrc $out/.direnv
|
||||
sed -i "s/version_replaceme/${version}/g" $out/main.go
|
||||
'';
|
||||
in
|
||||
{
|
||||
default = self.packages.${system}.pangolin-newt;
|
||||
|
||||
pangolin-newt = pkgs.buildGoModule {
|
||||
pname = "pangolin-newt";
|
||||
version = version;
|
||||
src = srcWithReplacedVersion;
|
||||
inherit version;
|
||||
src = pkgs.nix-gitignore.gitignoreSource [ ] ./.;
|
||||
|
||||
vendorHash = "sha256-iLUeQ16KLRPdAZT3DCe4eGjlqPrNJJ27BNLtTpeQlC0=";
|
||||
|
||||
ldflags = [
|
||||
"-X main.newtVersion=${version}"
|
||||
];
|
||||
|
||||
meta = with pkgs.lib; {
|
||||
description = "A tunneling client for Pangolin";
|
||||
homepage = "https://github.com/fosrl/newt";
|
||||
|
||||
Reference in New Issue
Block a user