Skip to content

Commit

Permalink
nixos/nextcloud-whiteboard-server: init
Browse files Browse the repository at this point in the history
  • Loading branch information
onny committed Oct 21, 2024
1 parent ff4e1d9 commit 79cf655
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 0 deletions.
1 change: 1 addition & 0 deletions nixos/modules/module-list.nix
Original file line number Diff line number Diff line change
Expand Up @@ -1471,6 +1471,7 @@
./services/web-apps/netbox.nix
./services/web-apps/nextcloud.nix
./services/web-apps/nextcloud-notify_push.nix
./services/web-apps/nextcloud-whiteboard-server.nix
./services/web-apps/nextjs-ollama-llm-ui.nix
./services/web-apps/nexus.nix
./services/web-apps/nifi.nix
Expand Down
72 changes: 72 additions & 0 deletions nixos/modules/services/web-apps/nextcloud-whiteboard-server.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
{
config,
lib,
pkgs,
...
}:

let

inherit (lib)
mkIf
mkEnableOption
mkOption
types
literalExpression
;
cfg = config.services.nextcloud-whiteboard-server;

in
{
options.services.nextcloud-whiteboard-server = {

enable = mkEnableOption "Nextcloud backend server for the Whiteboard app";

settings = mkOption {
type = types.attrsOf types.str;
default = { };
description = ''
Settings to configure backend server. Especially the Nextcloud host
url has to be set. The required environment variable `JWT_SECRET_KEY`
should be set via the secrets option.
'';
example = literalExpression ''
{
NEXTCLOUD_URL = "https://nextcloud.example.org";
}
'';
};

secrets = lib.mkOption {
type = with types; listOf path;
description = ''
A list of files containing the various secrets. Should be in the
format expected by systemd's `EnvironmentFile` directory.
'';
default = [ ];
};

};

config = mkIf cfg.enable {

systemd.services.nextcloud-whiteboard-server = {
description = "Nextcloud backend server for the Whiteboard app";
wantedBy = [ "multi-user.target" ];
after = [ "network-online.target" ];
wants = [ "network-online.target" ];
environment = cfg.settings;
serviceConfig = {
ExecStart = "${lib.getExe pkgs.nextcloud-whiteboard-server}";
WorkingDirectory = "/var/lib/whiteboard";
StateDirectory = "whiteboard";
EnvironmentFile = [ cfg.secrets ];
DynamicUser = true;
};
};

};

meta.maintainers = with lib.maintainers; [ onny ];

}

0 comments on commit 79cf655

Please sign in to comment.