File tree Expand file tree Collapse file tree 2 files changed +37
-21
lines changed
Expand file tree Collapse file tree 2 files changed +37
-21
lines changed Original file line number Diff line number Diff line change 22 description = "newt - A tunneling client for Pangolin" ;
33
44 inputs = {
5- nixpkgs . url = "github:NixOS/nixpkgs/nixos-25.05 " ;
5+ nixpkgs . url = "github:NixOS/nixpkgs/nixpkgs-unstable " ;
66 } ;
77
88 outputs =
2222 system :
2323 let
2424 pkgs = pkgsFor system ;
25+ inherit ( pkgs ) lib ;
2526
2627 # Update version when releasing
27- version = "1.4.2" ;
28-
29- # Update the version in a new source tree
30- srcWithReplacedVersion = pkgs . runCommand "newt-src-with-version" { } ''
31- cp -r ${ ./. } $out
32- chmod -R +w $out
33- rm -rf $out/.git $out/result $out/.envrc $out/.direnv
34- sed -i "s/version_replaceme/${ version } /g" $out/main.go
35- '' ;
28+ version = "1.6.0" ;
3629 in
3730 {
3831 default = self . packages . ${ system } . pangolin-newt ;
32+
3933 pangolin-newt = pkgs . buildGoModule {
4034 pname = "pangolin-newt" ;
41- version = version ;
42- src = srcWithReplacedVersion ;
43- vendorHash = "sha256-PENsCO2yFxLVZNPgx2OP+gWVNfjJAfXkwWS7tzlm490=" ;
44- meta = with pkgs . lib ; {
35+ inherit version ;
36+ src = pkgs . nix-gitignore . gitignoreSource [ ] ./. ;
37+
38+ vendorHash = "sha256-Jbu0pz+okV4N9MHUXLcTqSr3s/k5OVZ09hNuS/+4LFY=" ;
39+
40+ env = {
41+ CGO_ENABLED = 0 ;
42+ } ;
43+
44+ ldflags = [
45+ "-X main.newtVersion=${ version } "
46+ ] ;
47+
48+ meta = {
4549 description = "A tunneling client for Pangolin" ;
4650 homepage = "https://github.com/fosrl/newt" ;
47- license = licenses . gpl3 ;
48- maintainers = [ ] ;
51+ license = lib . licenses . gpl3 ;
52+ maintainers = [
53+ lib . maintainers . water-sucks
54+ ] ;
4955 } ;
5056 } ;
5157 }
5460 system :
5561 let
5662 pkgs = pkgsFor system ;
63+
64+ inherit ( pkgs )
65+ go
66+ gopls
67+ gotools
68+ go-outline
69+ gopkgs
70+ godef
71+ golint
72+ ;
5773 in
5874 {
5975 default = pkgs . mkShell {
60- buildInputs = with pkgs ; [
76+ buildInputs = [
6177 go
6278 gopls
6379 gotools
You can’t perform that action at this time.
0 commit comments