1 { config, lib, pkgs, ... }:
3 cfg = config.services.goeland;
4 tomlFormat = pkgs.formats.toml { };
7 options.services.goeland = {
8 enable = lib.mkEnableOption "goeland, an alternative to rss2email";
10 settings = lib.mkOption {
12 Configuration of goeland.
13 See the [example config file](https://github.com/slurdge/goeland/blob/master/cmd/asset/config.default.toml) for the available options.
16 type = tomlFormat.type;
18 schedule = lib.mkOption {
21 example = "Mon, 00:00:00";
22 description = "How often to run goeland, in systemd time format.";
24 stateDir = lib.mkOption {
25 type = lib.types.path;
26 default = "/var/lib/goeland";
28 The data directory for goeland where the database will reside if using the unseen filter.
29 If left as the default value this directory will automatically be created before the goeland
30 server starts, otherwise you are responsible for ensuring the directory exists with
31 appropriate ownership and permissions.
36 config = lib.mkIf cfg.enable {
37 services.goeland.settings.database = "${cfg.stateDir}/goeland.db";
39 systemd.services.goeland = {
40 serviceConfig = let confFile = tomlFormat.generate "config.toml" cfg.settings; in lib.mkMerge [
42 ExecStart = "${pkgs.goeland}/bin/goeland run -c ${confFile}";
46 (lib.mkIf (cfg.stateDir == "/var/lib/goeland") {
47 StateDirectory = "goeland";
48 StateDirectoryMode = "0750";
51 startAt = cfg.schedule;
54 users.users.goeland = {
55 description = "goeland user";
59 users.groups.goeland = { };
61 warnings = lib.optionals (lib.hasAttr "password" cfg.settings.email) [
63 It is not recommended to set the "services.goeland.settings.email.password"
64 option as it will be in cleartext in the Nix store.
65 Please use "services.goeland.settings.email.password_file" instead.
70 meta.maintainers = with lib.maintainers; [ sweenu ];