15 src = fetchFromGitHub {
18 rev = "refs/tags/v${version}";
19 hash = "sha256-HF5T/TZXiyT186qZyzz+m0K9ajF1wk8YAZljcq5ccWM=";
20 # populate values that require us to use git. By doing this in postFetch we
21 # can delete .git afterwards and maintain better reproducibility of the src.
25 git rev-parse HEAD > $out/COMMIT
26 # '0000-00-00T00:00:00Z'
27 date -u -d "@$(git log -1 --pretty=%ct)" "+%Y-%m-%dT%H:%M:%SZ" > $out/SOURCE_DATE_EPOCH
28 find "$out" -name .git -print0 | xargs -0 rm -rf
32 url = "https://github.com/AlistGo/alist-web/releases/download/${version}/dist.tar.gz";
33 hash = "sha256-jHbWhjvHfgtdocuuELbOwrMzL8tOQfBVdH9MxasEwGo=";
37 vendorHash = "sha256-Q5E86bNedXOqMKS3WrXicWg27vnjyGao0nE34Ws2l9E=";
39 buildInputs = [ fuse ];
41 tags = [ "jsoniter" ];
46 "-X \"github.com/alist-org/alist/v3/internal/conf.GitAuthor=Xhofe <i@nn.ci>\""
47 "-X github.com/alist-org/alist/v3/internal/conf.Version=${version}"
48 "-X github.com/alist-org/alist/v3/internal/conf.WebVersion=${version}"
52 # use matched web files
59 ldflags+=" -X \"github.com/alist-org/alist/v3/internal/conf.GoVersion=$(go version | sed 's/go version //')\""
60 ldflags+=" -X \"github.com/alist-org/alist/v3/internal/conf.BuiltAt=$(cat SOURCE_DATE_EPOCH)\""
61 ldflags+=" -X github.com/alist-org/alist/v3/internal/conf.GitCommit=$(cat COMMIT)"
66 # Skip tests that require network access
73 [ "-skip=^${builtins.concatStringsSep "$|^" skippedTests}$" ];
75 nativeBuildInputs = [ installShellFiles ];
77 postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
78 installShellCompletion --cmd alist \
79 --bash <($out/bin/alist completion bash) \
80 --fish <($out/bin/alist completion fish) \
81 --zsh <($out/bin/alist completion zsh)
84 doInstallCheck = true;
86 versionCheckProgramArg = "version";
88 nativeInstallCheckInputs = [
93 description = "File list/WebDAV program that supports multiple storages";
94 homepage = "https://github.com/alist-org/alist";
95 changelog = "https://github.com/alist-org/alist/releases/tag/v${version}";
96 license = with lib.licenses; [
101 maintainers = with lib.maintainers; [ moraxyc ];
102 sourceProvenance = with lib.sourceTypes; [
107 mainProgram = "alist";