lol

Merge pull request #318084 from katexochen/snicat/mods

snicat: migrate to buildGoModule

authored by

Paul Meyer and committed by
GitHub
58764932 be1eff5d

+15 -23
-12
pkgs/by-name/sn/snicat/deps.nix
··· 1 - [ 2 - { 3 - goPackagePath = "github.com/therootcompany/sclient"; 4 - fetch = { 5 - type = "FromGitHub"; 6 - owner = "therootcompany"; 7 - repo = "sclient"; 8 - rev = "v1.5.0"; 9 - sha256 = "sha256-NAFTOx2sm92K+d746Z5UpB1HGsJI6cJgmh+YTyVkJ0w="; 10 - }; 11 - } 12 - ]
+15 -11
pkgs/by-name/sn/snicat/package.nix
··· 1 1 { lib 2 - , buildGoPackage 2 + , buildGoModule 3 3 , fetchFromGitHub 4 + , fetchpatch 4 5 }: 5 - buildGoPackage rec { 6 + buildGoModule rec { 6 7 pname = "snicat"; 7 8 version = "0.0.1"; 8 9 ··· 13 14 hash = "sha256-fFlTBOz127le2Y7F9KKhbcldcyFEpAU5QiJ4VCAPs9Y="; 14 15 }; 15 16 16 - goPackagePath = "github.com/CTFd/snicat"; 17 - 18 - goDeps = ./deps.nix; 19 - 20 - ldflags = [ "-s" "-w" "-X main.version=v${version}" ]; 17 + patches = [ 18 + # Migrate to Go modules 19 + (fetchpatch { 20 + url = "https://github.com/CTFd/snicat/commit/098a5ce3141bae5d2e188338d78517d710d10f70.patch"; 21 + hash = "sha256-pIdXViUz14nkvL1H3u3oFkm308XA2POtKIGZOKDO6p8="; 22 + }) 23 + ]; 21 24 22 - installPhase = '' 23 - runHook preInstall 25 + vendorHash = "sha256-27ykI9HK1jFanxwa6QrN6ZS548JbFNSZHaXr4ciCVOE="; 26 + proxyVendor = true; 24 27 25 - install -Dm555 go/bin/snicat $out/bin/sc 28 + ldflags = [ "-s" "-X main.version=v${version}" ]; 26 29 27 - runHook postInstall 30 + postInstall = '' 31 + mv $out/bin/snicat $out/bin/sc 28 32 ''; 29 33 30 34 meta = with lib; {