1{
2 lib,
3 buildGoModule,
4 fetchFromGitHub,
5 nixosTests,
6}:
7
8let
9 # The web client verifies, that the server version is a valid datetime string:
10 # https://github.com/minio/minio/blob/3a0e7347cad25c60b2e51ff3194588b34d9e424c/browser/app/js/web.js#L51-L53
11 #
12 # Example:
13 # versionToTimestamp "2021-04-22T15-44-28Z"
14 # => "2021-04-22T15:44:28Z"
15 versionToTimestamp =
16 version:
17 let
18 splitTS = builtins.elemAt (builtins.split "(.*)(T.*)" version) 1;
19 in
20 builtins.concatStringsSep "" [
21 (builtins.elemAt splitTS 0)
22 (builtins.replaceStrings [ "-" ] [ ":" ] (builtins.elemAt splitTS 1))
23 ];
24
25 # CopyrightYear will be printed to the CLI UI.
26 # Example:
27 # versionToYear "2021-04-22T15-44-28Z"
28 # => "2021"
29 versionToYear = version: builtins.elemAt (lib.splitString "-" version) 0;
30in
31buildGoModule rec {
32 pname = "minio";
33 version = "2025-06-13T11-33-47Z";
34
35 src = fetchFromGitHub {
36 owner = "minio";
37 repo = "minio";
38 rev = "RELEASE.${version}";
39 hash = "sha256-pck/K/BJZC0OdjgeCr+3ErkOyqmVTCdZv61jG24tp2E=";
40 };
41
42 vendorHash = "sha256-0UoEIlxbAveYlCbGZ2z1q+RAksJrVjdE+ymc6ozDGcE=";
43
44 doCheck = false;
45
46 subPackages = [ "." ];
47
48 env.CGO_ENABLED = 0;
49
50 tags = [ "kqueue" ];
51
52 ldflags =
53 let
54 t = "github.com/minio/minio/cmd";
55 in
56 [
57 "-s"
58 "-w"
59 "-X ${t}.Version=${versionToTimestamp version}"
60 "-X ${t}.CopyrightYear=${versionToYear version}"
61 "-X ${t}.ReleaseTag=RELEASE.${version}"
62 "-X ${t}.CommitID=${src.rev}"
63 ];
64
65 passthru.tests.minio = nixosTests.minio;
66
67 meta = with lib; {
68 homepage = "https://www.minio.io/";
69 description = "S3-compatible object storage server";
70 changelog = "https://github.com/minio/minio/releases/tag/RELEASE.${version}";
71 maintainers = with maintainers; [
72 bachp
73 ryan4yin
74 ];
75 license = licenses.agpl3Plus;
76 mainProgram = "minio";
77 };
78}