9 cfg = config.services.gotify;
13 (lib.mkRenamedOptionModule
28 options.services.gotify = {
29 enable = lib.mkEnableOption "Gotify webserver";
31 package = lib.mkPackageOption pkgs "gotify-server" { };
33 environment = lib.mkOption {
34 type = lib.types.attrsOf (
42 GOTIFY_SERVER_PORT = 8080;
43 GOTIFY_DATABASE_DIALECT = "sqlite3";
46 Config environment variables for the gotify-server.
47 See https://gotify.net/docs/config for more details.
51 environmentFiles = lib.mkOption {
52 type = lib.types.listOf lib.types.path;
55 Files containing additional config environment variables for gotify-server.
56 Secrets should be set in environmentFiles instead of environment.
60 stateDirectoryName = lib.mkOption {
62 default = "gotify-server";
64 The name of the directory below {file}`/var/lib` where
65 gotify stores its runtime data.
70 config = lib.mkIf cfg.enable {
71 systemd.services.gotify-server = {
72 wantedBy = [ "multi-user.target" ];
73 after = [ "network.target" ];
74 description = "Simple server for sending and receiving messages";
76 environment = lib.mapAttrs (_: toString) cfg.environment;
79 WorkingDirectory = "/var/lib/${cfg.stateDirectoryName}";
80 StateDirectory = cfg.stateDirectoryName;
81 EnvironmentFile = cfg.environmentFiles;
84 ExecStart = lib.getExe cfg.package;
89 meta.maintainers = with lib.maintainers; [ DCsunset ];