{ lib, stdenv, buildGoModule, fetchFromGitHub, callPackage, installShellFiles, versionCheckHook, fuse, }: buildGoModule (finalAttrs: { pname = "openlist"; version = "4.1.0"; src = fetchFromGitHub { owner = "OpenListTeam"; repo = "OpenList"; tag = "v${finalAttrs.version}"; hash = "sha256-505rEnqIwn1EGhzqhcVWYgYqyPsV/obJzaHaK9W2tVA="; # populate values that require us to use git. By doing this in postFetch we # can delete .git afterwards and maintain better reproducibility of the src. leaveDotGit = true; postFetch = '' cd "$out" git rev-parse HEAD > $out/COMMIT # '0000-00-00T00:00:00Z' date -u -d "@$(git log -1 --pretty=%ct)" "+%Y-%m-%dT%H:%M:%SZ" > $out/SOURCE_DATE_EPOCH find "$out" -name .git -print0 | xargs -0 rm -rf ''; }; frontend = callPackage ./frontend.nix { }; proxyVendor = true; vendorHash = "sha256-J8ssJbILb3Gf6Br/PYkRAn4Haduf82iCYCfSAEi3nO4="; buildInputs = [ fuse ]; tags = [ "jsoniter" ]; ldflags = [ "-s" "-X \"github.com/OpenListTeam/OpenList/v4/internal/conf.GitAuthor=The OpenList Projects Contributors \"" "-X github.com/OpenListTeam/OpenList/v4/internal/conf.Version=${finalAttrs.version}" "-X github.com/OpenListTeam/OpenList/v4/internal/conf.WebVersion=${finalAttrs.frontend.version}" ]; preConfigure = '' rm -rf public/dist cp -r ${finalAttrs.frontend} public/dist ''; preBuild = '' ldflags+=" -X \"github.com/OpenListTeam/OpenList/v4/internal/conf.BuiltAt=$( $out/share/powershell/OpenList.Completion.ps1 ''; doInstallCheck = true; nativeInstallCheckInputs = [ versionCheckHook ]; versionCheckProgram = "${placeholder "out"}/bin/OpenList"; versionCheckProgramArg = "version"; passthru.updateScript = lib.getExe (callPackage ./update.nix { }); meta = { description = "AList Fork to Anti Trust Crisis"; homepage = "https://github.com/OpenListTeam/OpenList"; license = lib.licenses.agpl3Only; maintainers = with lib.maintainers; [ moraxyc ]; mainProgram = "OpenList"; }; })