filtron: use buildGoModule

+18 -49
+18 -8
pkgs/servers/filtron/default.nix
··· 1 - { lib, buildGoPackage, fetchFromGitHub }: 1 + { lib, buildGoModule, fetchFromGitHub, fetchpatch }: 2 2 3 - buildGoPackage rec { 3 + buildGoModule rec { 4 4 pname = "filtron"; 5 5 version = "0.2.0"; 6 6 7 - goPackagePath = "github.com/asciimoo/filtron"; 8 - 9 7 src = fetchFromGitHub { 10 8 owner = "asciimoo"; 11 9 repo = "filtron"; 12 10 rev = "v${version}"; 13 - sha256 = "18d3h0i2sfqbc0bjx26jm2n9f37zwp8z9z4wd17sw7nvkfa72a26"; 11 + hash = "sha256-RihxlJvbHq5PaJz89NHl/wyXrKjSiC4XYAs7LSKAo6E="; 14 12 }; 15 13 16 - goDeps = ./deps.nix; 14 + vendorHash = "sha256-1DRR16WiBGvhOpq12L5njJJRRCIA7ajs1Py9j/3cWPE="; 17 15 18 - # The upstream test checks are obsolete/unmaintained. 19 - doCheck = false; 16 + patches = [ 17 + # Update golang version in go.mod 18 + (fetchpatch { 19 + url = "https://github.com/asciimoo/filtron/commit/365a0131074b3b12aaa65194bfb542182a63413c.patch"; 20 + hash = "sha256-QGR6YetEzA/b6tC4uD94LBkWv0+9PG7RD72Tpkn2gQU="; 21 + }) 22 + # Add missing go.sum file 23 + (fetchpatch { 24 + url = "https://github.com/asciimoo/filtron/commit/077769282b4e392e96a194c8ae71ff9f693560ea.patch"; 25 + hash = "sha256-BhHbXDKiRjSzC6NKhKUiH6rjt/EgJcEprHMMJ1x/wiQ="; 26 + }) 27 + ]; 28 + 29 + ldflags = [ "-s" "-w" ]; 20 30 21 31 meta = with lib; { 22 32 description = "Reverse HTTP proxy to filter requests by different rules.";
-41
pkgs/servers/filtron/deps.nix
··· 1 - [ 2 - { 3 - goPackagePath = "github.com/valyala/fasthttp"; 4 - fetch = { 5 - type = "git"; 6 - url = "https://github.com/valyala/fasthttp"; 7 - rev = "v1.41.0"; 8 - sha256 = "sha256-lV9FP7GjnQk/kJACE9l5CZ/8kzORdNpYS5lPokEYrZM="; 9 - }; 10 - } 11 - 12 - { 13 - goPackagePath = "github.com/klauspost/compress"; 14 - fetch = { 15 - type = "git"; 16 - url = "https://github.com/klauspost/compress"; 17 - rev = "v1.15.12"; 18 - sha256 = "sha256-D41sCSbaqX9tXIRcTU9TYyjPyZpuKLDeQMXETE2ulbM="; 19 - }; 20 - } 21 - 22 - { 23 - goPackagePath = "github.com/valyala/bytebufferpool"; 24 - fetch = { 25 - type = "git"; 26 - url = "https://github.com/valyala/bytebufferpool"; 27 - rev = "v1.0.0"; 28 - sha256 = "sha256-I9FPZ3kCNRB+o0dpMwBnwZ35Fj9+ThvITn8a3Jr8mAY="; 29 - }; 30 - } 31 - 32 - { 33 - goPackagePath = "github.com/andybalholm/brotli"; 34 - fetch = { 35 - type = "git"; 36 - url = "https://github.com/andybalholm/brotli"; 37 - rev = "v1.0.4"; 38 - sha256 = "sha256-gAnPRdGP4yna4hiRIEDyBtDOVJqd7RU27wlPu96Rdf8="; 39 - }; 40 - } 41 - ]