diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index c00e31742f8f4f..e84580f8f0f150 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -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 diff --git a/nixos/modules/services/web-apps/nextcloud-whiteboard-server.nix b/nixos/modules/services/web-apps/nextcloud-whiteboard-server.nix new file mode 100644 index 00000000000000..b313fccf94d01a --- /dev/null +++ b/nixos/modules/services/web-apps/nextcloud-whiteboard-server.nix @@ -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 ]; + +} diff --git a/pkgs/by-name/ne/nextcloud-whiteboard-server/package.nix b/pkgs/by-name/ne/nextcloud-whiteboard-server/package.nix index 6904eef92f161a..f8cf00516c227f 100644 --- a/pkgs/by-name/ne/nextcloud-whiteboard-server/package.nix +++ b/pkgs/by-name/ne/nextcloud-whiteboard-server/package.nix @@ -8,16 +8,16 @@ }: buildNpmPackage rec { pname = "nextcloud-whiteboard-server"; - version = "1.0.2"; + version = "1.0.4"; src = fetchFromGitHub { owner = "nextcloud"; repo = "whiteboard"; rev = "refs/tags/v${version}"; - hash = "sha256-RoizzsSQHe2Tw52VcaqTGjbLS50VgTxk09yTIqkoyh4="; + hash = "sha256-27w8FZz9PbVdYV7yR5iRXi5edw7U/3bLVYfdRa8yPzo="; }; - npmDepsHash = "sha256-RZoMvDwTANdMm0+Z4SU2ifz7FgXQH+NdrKNspudgQTY="; + npmDepsHash = "sha256-SwFQRDRo7Q8+0zYWx5szahJzDSoxkkJDPQ3qEdNLVaE="; nativeBuildInputs = [ makeWrapper ];