diff options
author | Mostly Void <7rat13@gmail.com> | 2023-05-07 03:19:08 +0530 |
---|---|---|
committer | Mostly Void <7rat13@gmail.com> | 2023-07-15 10:22:21 +0200 |
commit | 9986d2cc90396fbafc154323dc820be9a7bc4ae9 (patch) | |
tree | 5be78553b9210f93498a973f04e36b773944aa39 | |
parent | 212f20a9071aaed1e70084f069b608502ce04651 (diff) |
mox: init at 0.0.5
-rw-r--r-- | pkgs/servers/mail/mox/default.nix | 34 | ||||
-rw-r--r-- | pkgs/servers/mail/mox/version.patch | 45 | ||||
-rw-r--r-- | pkgs/top-level/all-packages.nix | 2 |
3 files changed, 81 insertions, 0 deletions
diff --git a/pkgs/servers/mail/mox/default.nix b/pkgs/servers/mail/mox/default.nix new file mode 100644 index 0000000000000..2dd7712c2c887 --- /dev/null +++ b/pkgs/servers/mail/mox/default.nix @@ -0,0 +1,34 @@ +{ lib +, buildGoModule +, fetchFromGitHub +}: + +buildGoModule rec { + pname = "mox"; + version = "0.0.5"; + + src = fetchFromGitHub { + owner = "mjl-"; + repo = "mox"; + rev = "v${version}"; + hash = "sha256-f5/K6cPqJJkbdiVCNGOTd9Fjx2/gvSZCxeR6nnEaeJw="; + }; + + # set the version during buildtime + patches = [ ./version.patch ]; + + vendorHash = null; + + ldflags = [ + "-s" + "-w" + "-X github.com/mjl-/mox/moxvar.Version=${version}" + ]; + + meta = { + description = "Modern full-featured open source secure mail server for low-maintenance self-hosted email"; + homepage = "https://github.com/mjl-/mox"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ dit7ya ]; + }; +} diff --git a/pkgs/servers/mail/mox/version.patch b/pkgs/servers/mail/mox/version.patch new file mode 100644 index 0000000000000..c842275ac9e49 --- /dev/null +++ b/pkgs/servers/mail/mox/version.patch @@ -0,0 +1,45 @@ +diff --git a/moxvar/version.go b/moxvar/version.go +index 8c6bac8..69b5f7c 100644 +--- a/moxvar/version.go ++++ b/moxvar/version.go +@@ -1,38 +1,5 @@ + // Package moxvar provides the version number of a mox build. + package moxvar + +-import ( +- "runtime/debug" +-) +- +-// Version is set at runtime based on the Go module used to build. +-var Version = "(devel)" +- +-func init() { +- buildInfo, ok := debug.ReadBuildInfo() +- if !ok { +- return +- } +- Version = buildInfo.Main.Version +- if Version == "(devel)" { +- var vcsRev, vcsMod string +- for _, setting := range buildInfo.Settings { +- if setting.Key == "vcs.revision" { +- vcsRev = setting.Value +- } else if setting.Key == "vcs.modified" { +- vcsMod = setting.Value +- } +- } +- if vcsRev == "" { +- return +- } +- Version = vcsRev +- switch vcsMod { +- case "false": +- case "true": +- Version += "+modifications" +- default: +- Version += "+unknown" +- } +- } +-} ++// Version is set via a build flag ++var Version string; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index aab96ffb2ac26..4d2a1b0c54754 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -6167,6 +6167,8 @@ with pkgs; mountain-duck = callPackage ../tools/filesystems/mountain-duck { }; + mox = callPackage ../servers/mail/mox { }; + mozlz4a = callPackage ../tools/compression/mozlz4a { }; msr-tools = callPackage ../os-specific/linux/msr-tools { }; |