From 5dd4aacb6fd0d693278c601de95d7f23d5ad571d Mon Sep 17 00:00:00 2001 From: Emmanouil Kampitakis Date: Thu, 7 Jul 2022 22:06:22 +0200 Subject: [PATCH 1/3] maintainers: add madonius --- maintainers/maintainer-list.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index 4ad1b83c20c3..79dacff88b1c 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -8104,6 +8104,13 @@ githubId = 109141; name = "Georges Dubus"; }; + madonius = { + email = "nixos@madoni.us"; + github = "madonius"; + githubId = 1246752; + name = "madonius"; + matrix = "@madonius:entropia.de"; + }; Madouura = { email = "madouura@gmail.com"; github = "Madouura"; From 3ae83c60f4fc30f3447ea700bc1983a6b01d2412 Mon Sep 17 00:00:00 2001 From: Emmanouil Kampitakis Date: Fri, 16 Sep 2022 21:45:03 +0200 Subject: [PATCH 2/3] alps: strip binary, add madonius as maintainer --- pkgs/servers/alps/default.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkgs/servers/alps/default.nix b/pkgs/servers/alps/default.nix index 2a98b9717085..a2f69473fbaa 100644 --- a/pkgs/servers/alps/default.nix +++ b/pkgs/servers/alps/default.nix @@ -14,6 +14,8 @@ buildGoModule rec { vendorSha256 = "sha256-cpY+lYM/nAX3nUaFknrRAavxDk8UDzJkoqFjJ1/KWeg="; ldflags = [ + "-s" + "-w" "-X main.themesPath=${placeholder "out"}/share/alps/themes" "-X git.sr.ht/~migadu/alps.PluginDir=${placeholder "out"}/share/alps/plugins" ]; @@ -33,6 +35,6 @@ buildGoModule rec { description = "A simple and extensible webmail."; homepage = "https://git.sr.ht/~migadu/alps"; license = licenses.mit; - maintainers = with maintainers; [ gordias booklearner ]; + maintainers = with maintainers; [ gordias booklearner madonius ]; }; } From 85f0887662676f17dbb45c10f7b391ba13bd035a Mon Sep 17 00:00:00 2001 From: Emmanouil Kampitakis Date: Fri, 16 Sep 2022 21:45:29 +0200 Subject: [PATCH 3/3] nixos/alps: init module --- .../from_md/release-notes/rl-2211.section.xml | 7 ++ .../manual/release-notes/rl-2211.section.md | 2 + nixos/modules/module-list.nix | 1 + nixos/modules/services/web-apps/alps.nix | 96 +++++++++++++++++++ 4 files changed, 106 insertions(+) create mode 100644 nixos/modules/services/web-apps/alps.nix diff --git a/nixos/doc/manual/from_md/release-notes/rl-2211.section.xml b/nixos/doc/manual/from_md/release-notes/rl-2211.section.xml index 931361984139..eb3302440cf0 100644 --- a/nixos/doc/manual/from_md/release-notes/rl-2211.section.xml +++ b/nixos/doc/manual/from_md/release-notes/rl-2211.section.xml @@ -225,6 +225,13 @@ services.outline. + + + alps, + a simple and extensible webmail. Available as + services.alps. + + netbird, a zero diff --git a/nixos/doc/manual/release-notes/rl-2211.section.md b/nixos/doc/manual/release-notes/rl-2211.section.md index ecebaae0d258..183ad4749bea 100644 --- a/nixos/doc/manual/release-notes/rl-2211.section.md +++ b/nixos/doc/manual/release-notes/rl-2211.section.md @@ -83,6 +83,8 @@ In addition to numerous new and upgraded packages, this release has the followin - [Outline](https://www.getoutline.com/), a wiki and knowledge base similar to Notion. Available as [services.outline](#opt-services.outline.enable). +- [alps](https://git.sr.ht/~migadu/alps), a simple and extensible webmail. Available as [services.alps](#opt-services.alps.enable). + - [netbird](https://netbird.io), a zero configuration VPN. Available as [services.netbird](options.html#opt-services.netbird.enable). diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index d5ab997bda38..998919f2a43a 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -1054,6 +1054,7 @@ ./services/video/epgstation/default.nix ./services/video/mirakurun.nix ./services/video/replay-sorcery.nix + ./services/web-apps/alps.nix ./services/web-apps/atlassian/confluence.nix ./services/web-apps/atlassian/crowd.nix ./services/web-apps/atlassian/jira.nix diff --git a/nixos/modules/services/web-apps/alps.nix b/nixos/modules/services/web-apps/alps.nix new file mode 100644 index 000000000000..b171729fd0a3 --- /dev/null +++ b/nixos/modules/services/web-apps/alps.nix @@ -0,0 +1,96 @@ +{ lib, pkgs, config, ... }: + +with lib; + +let + cfg = config.services.alps; +in { + options.services.alps = { + enable = mkEnableOption (lib.mdDoc "alps"); + + port = mkOption { + type = types.port; + default = 1323; + description = lib.mdDoc '' + TCP port the service should listen on. + ''; + }; + + bindIP = mkOption { + default = "[::]"; + type = types.str; + description = lib.mdDoc '' + The IP the service should listen on. + ''; + }; + + theme = mkOption { + type = types.enum [ "alps" "sourcehut" ]; + default = "sourcehut"; + description = lib.mdDoc '' + The frontend's theme to use. + ''; + }; + + imaps = { + port = mkOption { + type = types.port; + default = 993; + description = lib.mdDoc '' + The IMAPS server port. + ''; + }; + + host = mkOption { + type = types.str; + default = "[::1]"; + example = "mail.example.org"; + description = lib.mdDoc '' + The IMAPS server address. + ''; + }; + }; + + smtps = { + port = mkOption { + type = types.port; + default = 445; + description = lib.mdDoc '' + The SMTPS server port. + ''; + }; + + host = mkOption { + type = types.str; + default = cfg.imaps.host; + defaultText = "services.alps.imaps.host"; + example = "mail.example.org"; + description = lib.mdDoc '' + The SMTPS server address. + ''; + }; + }; + }; + + config = mkIf cfg.enable { + systemd.services.alps = { + description = "alps is a simple and extensible webmail."; + documentation = [ "https://git.sr.ht/~migadu/alps" ]; + wantedBy = [ "multi-user.target" ]; + after = [ "network.target" "network-online.target" ]; + + serviceConfig = { + ExecStart = '' + ${pkgs.alps}/bin/alps \ + -addr ${cfg.bindIP}:${toString cfg.port} \ + -theme ${cfg.theme} \ + imaps://${cfg.imaps.host}:${toString cfg.imaps.port} \ + smpts://${cfg.smtps.host}:${toString cfg.smtps.port} + ''; + StateDirectory = "alps"; + WorkingDirectory = "/var/lib/alps"; + DynamicUser = true; + }; + }; + }; +}