13 , sqliteSupport ? true
25 # not fetching directly from the git repo, because that lacks several vendor files for the web UI
27 url = "https://dl.gitea.com/gitea/${version}/gitea-src-${version}.tar.gz";
28 hash = "sha256-TxysXw3lVdV/hlILztM+D7wIpeqXfglAy7Ak2AxnlEM=";
34 ./static-root-path.patch
38 substituteInPlace modules/setting/server.go --subst-var data
41 subPackages = [ "." ];
43 nativeBuildInputs = [ makeWrapper ];
45 buildInputs = lib.optional pamSupport pam;
47 tags = lib.optional pamSupport "pam"
48 ++ lib.optionals sqliteSupport [ "sqlite" "sqlite_unlock_notify" ];
53 "-X main.Version=${version}"
54 "-X 'main.Tags=${lib.concatStringsSep " " tags}'"
57 outputs = [ "out" "data" ];
61 cp -R ./{public,templates,options} $data
63 cp -R ./options/locale $out/locale
65 wrapProgram $out/bin/gitea \
66 --prefix PATH : ${lib.makeBinPath [ bash coreutils git gzip openssh ]}
70 data-compressed = runCommand "gitea-data-compressed" {
71 nativeBuildInputs = [ brotli xorg.lndir ];
74 lndir ${gitea.data}/ $out/
76 # Create static gzip and brotli files
77 find -L $out -type f -regextype posix-extended -iregex '.*\.(css|html|js|svg|ttf|txt)' \
78 -exec gzip --best --keep --force {} ';' \
79 -exec brotli --best --keep --no-copy-stat {} ';'
82 tests = nixosTests.gitea;
86 description = "Git with a cup of tea";
87 homepage = "https://gitea.io";
88 license = licenses.mit;
89 maintainers = with maintainers; [ disassembler kolaente ma27 techknowlogick ];
90 broken = stdenv.isDarwin;
91 mainProgram = "gitea";