omnom: init at 0-unstable-2024-08-29 (#339846)

authored by Weijia Wang and committed by GitHub 1c0b85b1 e09e0b5a

+143
+83
pkgs/by-name/om/omnom/0001-fix-minimal-go-version.patch
··· 1 + Bump the minimal Go version as some features require Go 1.17 and higher to work 2 + 3 + --- 4 + go.mod | 48 ++++++++++++++++++++++++++++++++++++++---------- 5 + 1 file changed, 38 insertions(+), 10 deletions(-) 6 + 7 + diff --git a/go.mod b/go.mod 8 + index 1756ffe..81f7fa2 100644 9 + --- a/go.mod 10 + +++ b/go.mod 11 + @@ -1,31 +1,59 @@ 12 + module github.com/asciimoo/omnom 13 + 14 + -go 1.15 15 + +go 1.17 16 + 17 + require ( 18 + - github.com/boj/redistore v0.0.0-20180917114910-cd5dcc76aeff // indirect 19 + - github.com/bytedance/sonic v1.12.1 // indirect 20 + - github.com/gabriel-vasile/mimetype v1.4.5 // indirect 21 + github.com/gin-contrib/multitemplate v1.0.1 22 + github.com/gin-gonic/contrib v0.0.0-20240508051311-c1c6bf0061b0 23 + github.com/gin-gonic/gin v1.10.0 24 + + github.com/spf13/cobra v1.8.1 25 + + github.com/xhit/go-simple-mail/v2 v2.16.0 26 + + golang.org/x/net v0.27.0 27 + + gopkg.in/yaml.v2 v2.4.0 28 + + gorm.io/driver/sqlite v1.5.6 29 + + gorm.io/gorm v1.25.11 30 + +) 31 + + 32 + +require ( 33 + + github.com/boj/redistore v0.0.0-20180917114910-cd5dcc76aeff // indirect 34 + + github.com/bytedance/sonic v1.12.1 // indirect 35 + + github.com/bytedance/sonic/loader v0.2.0 // indirect 36 + + github.com/cloudwego/base64x v0.1.4 // indirect 37 + + github.com/cloudwego/iasm v0.2.0 // indirect 38 + + github.com/gabriel-vasile/mimetype v1.4.5 // indirect 39 + + github.com/gin-contrib/sse v0.1.0 // indirect 40 + + github.com/go-playground/locales v0.14.1 // indirect 41 + + github.com/go-playground/universal-translator v0.18.1 // indirect 42 + github.com/go-playground/validator/v10 v10.22.0 // indirect 43 + github.com/go-test/deep v1.1.1 // indirect 44 + github.com/goccy/go-json v0.10.3 // indirect 45 + + github.com/gomodule/redigo v2.0.0+incompatible // indirect 46 + + github.com/google/go-cmp v0.6.0 // indirect 47 + github.com/gorilla/context v1.1.2 // indirect 48 + + github.com/gorilla/securecookie v1.1.2 // indirect 49 + github.com/gorilla/sessions v1.3.0 // indirect 50 + + github.com/inconshreveable/mousetrap v1.1.0 // indirect 51 + + github.com/jinzhu/inflection v1.0.0 // indirect 52 + + github.com/jinzhu/now v1.1.5 // indirect 53 + + github.com/json-iterator/go v1.1.12 // indirect 54 + github.com/klauspost/cpuid/v2 v2.2.8 // indirect 55 + github.com/kr/pretty v0.3.0 // indirect 56 + + github.com/leodido/go-urn v1.4.0 // indirect 57 + + github.com/mattn/go-isatty v0.0.20 // indirect 58 + + github.com/mattn/go-sqlite3 v1.14.22 // indirect 59 + + github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect 60 + + github.com/modern-go/reflect2 v1.0.2 // indirect 61 + + github.com/pelletier/go-toml/v2 v2.2.2 // indirect 62 + github.com/rogpeppe/go-internal v1.8.0 // indirect 63 + - github.com/spf13/cobra v1.8.1 64 + + github.com/spf13/pflag v1.0.5 // indirect 65 + github.com/toorop/go-dkim v0.0.0-20240103092955-90b7d1423f92 // indirect 66 + - github.com/xhit/go-simple-mail/v2 v2.16.0 67 + + github.com/twitchyliquid64/golang-asm v0.15.1 // indirect 68 + + github.com/ugorji/go/codec v1.2.12 // indirect 69 + golang.org/x/arch v0.9.0 // indirect 70 + - golang.org/x/net v0.27.0 71 + + golang.org/x/crypto v0.25.0 // indirect 72 + golang.org/x/sys v0.23.0 // indirect 73 + + golang.org/x/text v0.16.0 // indirect 74 + google.golang.org/protobuf v1.34.2 // indirect 75 + gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect 76 + - gopkg.in/yaml.v2 v2.4.0 77 + - gorm.io/driver/sqlite v1.5.6 78 + - gorm.io/gorm v1.25.11 79 + + gopkg.in/yaml.v3 v3.0.1 // indirect 80 + ) 81 + -- 82 + 2.45.2 83 +
+60
pkgs/by-name/om/omnom/package.nix
··· 1 + { 2 + lib, 3 + buildGoModule, 4 + fetchFromGitHub, 5 + makeWrapper, 6 + }: 7 + 8 + buildGoModule { 9 + pname = "omnom"; 10 + version = "0-unstable-2024-08-29"; 11 + 12 + src = fetchFromGitHub { 13 + owner = "asciimoo"; 14 + repo = "omnom"; 15 + rev = "1fcd7787886503f703bbcd31b193d4c93acc5610"; 16 + hash = "sha256-o/n8rgngQkYEn8J0aFpCiD4qrWVFaaa305OxiscU6+8="; 17 + fetchSubmodules = true; 18 + }; 19 + 20 + vendorHash = "sha256-dsS5w8JXIwkneWScOFzLSDiXq+clgK+RdYiMw0+FnvY="; 21 + 22 + patches = [ ./0001-fix-minimal-go-version.patch ]; 23 + 24 + nativeBuildInputs = [ makeWrapper ]; 25 + 26 + ldflags = [ 27 + "-s" 28 + "-w" 29 + ]; 30 + 31 + postPatch = '' 32 + # For the default config to work, we have to put `static/data` and 33 + # `db.sqlite3` in a temporary directory since they need to be writeable. 34 + # 35 + # NOTE: Currently, `static/data` only holds the snapshots directory. 36 + substituteInPlace config.yml \ 37 + --replace-fail 'root: "./static/data"' 'root: "/tmp/omnom/static/data"' \ 38 + --replace-fail 'connection: "./db.sqlite3"' 'connection: "/tmp/omnom/db.sqlite3"' \ 39 + --replace-fail 'debug: true' 'debug: false' 40 + ''; 41 + 42 + postInstall = '' 43 + mkdir -p $out/share 44 + cp -r config.yml static templates $out/share 45 + 46 + wrapProgram $out/bin/omnom \ 47 + --chdir $out/share \ 48 + --set-default GIN_MODE release 49 + ''; 50 + 51 + meta = { 52 + description = "A webpage bookmarking and snapshotting service"; 53 + homepage = "https://github.com/asciimoo/omnom"; 54 + license = lib.licenses.agpl3Only; 55 + maintainers = [ 56 + # maintained by the team working on NGI-supported software, no group for this yet 57 + ]; 58 + mainProgram = "omnom"; 59 + }; 60 + }