-
-
Notifications
You must be signed in to change notification settings - Fork 14.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
nextcloudPackages.whiteboard: init at 1.0.4; nextcloudPackages: update (
- Loading branch information
Showing
7 changed files
with
189 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
72 changes: 72 additions & 0 deletions
72
nixos/modules/services/web-apps/nextcloud-whiteboard-server.nix
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 str; | ||
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 = "%S/whiteboard"; | ||
StateDirectory = "whiteboard"; | ||
EnvironmentFile = [ cfg.secrets ]; | ||
DynamicUser = true; | ||
}; | ||
}; | ||
|
||
}; | ||
|
||
meta.maintainers = with lib.maintainers; [ onny ]; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
{ | ||
lib, | ||
buildNpmPackage, | ||
fetchFromGitHub, | ||
stdenv, | ||
makeWrapper, | ||
nodejs, | ||
}: | ||
buildNpmPackage rec { | ||
pname = "nextcloud-whiteboard-server"; | ||
version = "1.0.4"; | ||
|
||
src = fetchFromGitHub { | ||
owner = "nextcloud"; | ||
repo = "whiteboard"; | ||
rev = "refs/tags/v${version}"; | ||
hash = "sha256-27w8FZz9PbVdYV7yR5iRXi5edw7U/3bLVYfdRa8yPzo="; | ||
}; | ||
|
||
npmDepsHash = "sha256-SwFQRDRo7Q8+0zYWx5szahJzDSoxkkJDPQ3qEdNLVaE="; | ||
|
||
nativeBuildInputs = [ makeWrapper ]; | ||
|
||
postInstall = '' | ||
makeWrapper ${lib.getExe nodejs} "$out/bin/nextcloud-whiteboard-server" \ | ||
--add-flags "$out/lib/node_modules/whiteboard/websocket_server/main.js" | ||
''; | ||
|
||
meta = { | ||
description = "Backend server for the Nextcloud Whiteboard app"; | ||
homepage = "https://apps.nextcloud.com/apps/whiteboard"; | ||
license = lib.licenses.agpl3Plus; | ||
maintainers = [ lib.maintainers.onny ]; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.