diff --git a/pkgs/by-name/sn/snicat/deps.nix b/pkgs/by-name/sn/snicat/deps.nix deleted file mode 100644 index dca575f88344..000000000000 --- a/pkgs/by-name/sn/snicat/deps.nix +++ /dev/null @@ -1,12 +0,0 @@ -[ - { - goPackagePath = "github.com/therootcompany/sclient"; - fetch = { - type = "FromGitHub"; - owner = "therootcompany"; - repo = "sclient"; - rev = "v1.5.0"; - sha256 = "sha256-NAFTOx2sm92K+d746Z5UpB1HGsJI6cJgmh+YTyVkJ0w="; - }; - } -] diff --git a/pkgs/by-name/sn/snicat/package.nix b/pkgs/by-name/sn/snicat/package.nix index bbc3fded5b2f..d38a45f59389 100644 --- a/pkgs/by-name/sn/snicat/package.nix +++ b/pkgs/by-name/sn/snicat/package.nix @@ -1,8 +1,9 @@ { lib -, buildGoPackage +, buildGoModule , fetchFromGitHub +, fetchpatch }: -buildGoPackage rec { +buildGoModule rec { pname = "snicat"; version = "0.0.1"; @@ -13,18 +14,21 @@ buildGoPackage rec { hash = "sha256-fFlTBOz127le2Y7F9KKhbcldcyFEpAU5QiJ4VCAPs9Y="; }; - goPackagePath = "github.com/CTFd/snicat"; + patches = [ + # Migrate to Go modules + (fetchpatch { + url = "https://github.com/CTFd/snicat/commit/098a5ce3141bae5d2e188338d78517d710d10f70.patch"; + hash = "sha256-pIdXViUz14nkvL1H3u3oFkm308XA2POtKIGZOKDO6p8="; + }) + ]; - goDeps = ./deps.nix; + vendorHash = "sha256-27ykI9HK1jFanxwa6QrN6ZS548JbFNSZHaXr4ciCVOE="; + proxyVendor = true; - ldflags = [ "-s" "-w" "-X main.version=v${version}" ]; + ldflags = [ "-s" "-X main.version=v${version}" ]; - installPhase = '' - runHook preInstall - - install -Dm555 go/bin/snicat $out/bin/sc - - runHook postInstall + postInstall = '' + mv $out/bin/snicat $out/bin/sc ''; meta = with lib; {