mirror of
https://github.com/fosrl/newt.git
synced 2026-03-04 09:46:44 +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
|
# Update version when releasing
|
||||||
version = "1.4.2";
|
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
|
in
|
||||||
{
|
{
|
||||||
default = self.packages.${system}.pangolin-newt;
|
default = self.packages.${system}.pangolin-newt;
|
||||||
|
|
||||||
pangolin-newt = pkgs.buildGoModule {
|
pangolin-newt = pkgs.buildGoModule {
|
||||||
pname = "pangolin-newt";
|
pname = "pangolin-newt";
|
||||||
version = version;
|
inherit version;
|
||||||
src = srcWithReplacedVersion;
|
src = pkgs.nix-gitignore.gitignoreSource [ ] ./.;
|
||||||
|
|
||||||
vendorHash = "sha256-iLUeQ16KLRPdAZT3DCe4eGjlqPrNJJ27BNLtTpeQlC0=";
|
vendorHash = "sha256-iLUeQ16KLRPdAZT3DCe4eGjlqPrNJJ27BNLtTpeQlC0=";
|
||||||
|
|
||||||
|
ldflags = [
|
||||||
|
"-X main.newtVersion=${version}"
|
||||||
|
];
|
||||||
|
|
||||||
meta = with pkgs.lib; {
|
meta = with pkgs.lib; {
|
||||||
description = "A tunneling client for Pangolin";
|
description = "A tunneling client for Pangolin";
|
||||||
homepage = "https://github.com/fosrl/newt";
|
homepage = "https://github.com/fosrl/newt";
|
||||||
|
|||||||
Reference in New Issue
Block a user