summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron Andersen <aaron@fosslib.net>2023-01-20 23:06:12 -0500
committerGitHub <noreply@github.com>2023-01-20 23:06:12 -0500
commitad161ee67ce072cdef34d451031d6abebca8e93c (patch)
treeda5d494399212c666d7b578731338f7345b3c781
parent9c8c055873b0eb33995c732049c6bcacd8296883 (diff)
parentdbbb062d479e938e662ba27f0edcebbad6518fe7 (diff)
Merge pull request #206099 from sweenu/add-goeland-module
nixos/goeland: init
-rw-r--r--nixos/doc/manual/from_md/release-notes/rl-2305.section.xml8
-rw-r--r--nixos/doc/manual/release-notes/rl-2305.section.md2
-rw-r--r--nixos/modules/module-list.nix1
-rw-r--r--nixos/modules/services/mail/goeland.nix74
-rw-r--r--pkgs/applications/networking/feedreaders/goeland/default.nix9
5 files changed, 90 insertions, 4 deletions
diff --git a/nixos/doc/manual/from_md/release-notes/rl-2305.section.xml b/nixos/doc/manual/from_md/release-notes/rl-2305.section.xml
index 9a59fcb0a2c1..6cafb6dd421f 100644
--- a/nixos/doc/manual/from_md/release-notes/rl-2305.section.xml
+++ b/nixos/doc/manual/from_md/release-notes/rl-2305.section.xml
@@ -85,6 +85,14 @@
</listitem>
<listitem>
<para>
+ <link xlink:href="https://github.com/slurdge/goeland">goeland</link>,
+ an alternative to rss2email written in golang with many
+ filters. Available as
+ <link linkend="opt-services.goeland.enable">services.goeland</link>.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
<link xlink:href="https://github.com/ellie/atuin">atuin</link>,
a sync server for shell history. Available as
<link linkend="opt-services.atuin.enable">services.atuin</link>.
diff --git a/nixos/doc/manual/release-notes/rl-2305.section.md b/nixos/doc/manual/release-notes/rl-2305.section.md
index d9edd64f42c1..8c25eae45588 100644
--- a/nixos/doc/manual/release-notes/rl-2305.section.md
+++ b/nixos/doc/manual/release-notes/rl-2305.section.md
@@ -30,6 +30,8 @@ In addition to numerous new and upgraded packages, this release has the followin
- [stevenblack-blocklist](https://github.com/StevenBlack/hosts), A unified hosts file with base extensions for blocking unwanted websites. Available as [networking.stevenblack](options.html#opt-networking.stevenblack.enable).
+- [goeland](https://github.com/slurdge/goeland), an alternative to rss2email written in golang with many filters. Available as [services.goeland](#opt-services.goeland.enable).
+
- [atuin](https://github.com/ellie/atuin), a sync server for shell history. Available as [services.atuin](#opt-services.atuin.enable).
- [mmsd](https://gitlab.com/kop316/mmsd), a lower level daemon that transmits and recieves MMSes. Available as [services.mmsd](#opt-services.mmsd.enable).
diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix
index dce6e878540d..45a7acdedc41 100644
--- a/nixos/modules/module-list.nix
+++ b/nixos/modules/module-list.nix
@@ -530,6 +530,7 @@
./services/mail/dovecot.nix
./services/mail/dspam.nix
./services/mail/exim.nix
+ ./services/mail/goeland.nix
./services/mail/listmonk.nix
./services/mail/maddy.nix
./services/mail/mail.nix
diff --git a/nixos/modules/services/mail/goeland.nix b/nixos/modules/services/mail/goeland.nix
new file mode 100644
index 000000000000..13092a65ed90
--- /dev/null
+++ b/nixos/modules/services/mail/goeland.nix
@@ -0,0 +1,74 @@
+{ config, lib, pkgs, ... }:
+
+with lib;
+
+let
+ cfg = config.services.goeland;
+ tomlFormat = pkgs.formats.toml { };
+in
+{
+ options.services.goeland = {
+ enable = mkEnableOption (mdDoc "goeland");
+
+ settings = mkOption {
+ description = mdDoc ''
+ Configuration of goeland.
+ See the [example config file](https://github.com/slurdge/goeland/blob/master/cmd/asset/config.default.toml) for the available options.
+ '';
+ default = { };
+ type = tomlFormat.type;
+ };
+ schedule = mkOption {
+ type = types.str;
+ default = "12h";
+ example = "Mon, 00:00:00";
+ description = mdDoc "How often to run goeland, in systemd time format.";
+ };
+ stateDir = mkOption {
+ type = types.path;
+ default = "/var/lib/goeland";
+ description = mdDoc ''
+ The data directory for goeland where the database will reside if using the unseen filter.
+ If left as the default value this directory will automatically be created before the goeland
+ server starts, otherwise you are responsible for ensuring the directory exists with
+ appropriate ownership and permissions.
+ '';
+ };
+ };
+
+ config = mkIf cfg.enable {
+ services.goeland.settings.database = "${cfg.stateDir}/goeland.db";
+
+ systemd.services.goeland = {
+ serviceConfig = let confFile = tomlFormat.generate "config.toml" cfg.settings; in mkMerge [
+ {
+ ExecStart = "${pkgs.goeland}/bin/goeland run -c ${confFile}";
+ User = "goeland";
+ Group = "goeland";
+ }
+ (mkIf (cfg.stateDir == "/var/lib/goeland") {
+ StateDirectory = "goeland";
+ StateDirectoryMode = "0750";
+ })
+ ];
+ startAt = cfg.schedule;
+ };
+
+ users.users.goeland = {
+ description = "goeland user";
+ group = "goeland";
+ isSystemUser = true;
+ };
+ users.groups.goeland = { };
+
+ warnings = optionals (hasAttr "password" cfg.settings.email) [
+ ''
+ It is not recommended to set the "services.goeland.settings.email.password"
+ option as it will be in cleartext in the Nix store.
+ Please use "services.goeland.settings.email.password_file" instead.
+ ''
+ ];
+ };
+
+ meta.maintainers = with maintainers; [ sweenu ];
+}
diff --git a/pkgs/applications/networking/feedreaders/goeland/default.nix b/pkgs/applications/networking/feedreaders/goeland/default.nix
index 946e145a5707..270cb7cdb622 100644
--- a/pkgs/applications/networking/feedreaders/goeland/default.nix
+++ b/pkgs/applications/networking/feedreaders/goeland/default.nix
@@ -23,14 +23,15 @@ buildGoModule rec {
];
meta = with lib; {
- description = "An alternative to RSS2Email written in golang with many filters.";
+ description = "An alternative to rss2email written in golang with many filters";
longDescription = ''
- Goeland excels at creating beautiful emails from RSS,
- tailored for daily or weekly digest. It include a number of
+ Goeland excels at creating beautiful emails from RSS feeds,
+ tailored for daily or weekly digest. It includes a number of
filters that can transform the RSS content along the way.
- It can also consume other sources, such as a Imgur tag.
+ It can also consume other sources, such as Imgur tags.
'';
homepage = "https://github.com/slurdge/goeland";
+ changelog = "https://github.com/slurdge/goeland/blob/v${version}/CHANGELOG.md";
license = with licenses; [ mit ];
maintainers = [ maintainers.sweenu ];
};