This commit is contained in:
silver 2023-12-27 15:48:58 +00:00
parent f1782633cd
commit 351f6b22da
2 changed files with 13 additions and 9 deletions

View file

@ -2,7 +2,6 @@
lib,
buildNpmPackage,
fetchFromGitHub,
pkgs,
jq,
python3,
pkg-config,
@ -23,7 +22,7 @@ in
};
postPatch = ''
jq 'del(.scripts.preinstall)' package.json > package.json.tmp
${lib.getExe jq} 'del(.scripts.preinstall)' package.json > package.json.tmp
mv -f package.json{.tmp,}
'';
@ -53,7 +52,6 @@ in
];
nativeBuildInputs = [
jq
python3
pkg-config
];

View file

@ -31,7 +31,10 @@ in {
};
ldap = mkOption {
description = lib.mdDoc "Options to configure the LDAP connection.";
description = lib.mdDoc ''
Options to configure the LDAP connection.
If you used the desktop application to test the configuration you can find the settings by searching for `ldap` in `~/.config/Bitwarden\ Directory\ Connector/data.json`.
'';
default = {};
type = types.submodule ({
@ -102,7 +105,10 @@ in {
};
sync = mkOption {
description = lib.mdDoc "Options to configure what gets synced.";
description = lib.mdDoc ''
Options to configure what gets synced.
If you used the desktop application to test the configuration you can find the settings by searching for `sync` in `~/.config/Bitwarden\ Directory\ Connector/data.json`.
'';
default = {};
type = types.submodule ({
@ -253,18 +259,18 @@ in {
};
systemd = {
timers.bitwarden_directory_connector = {
timers.bitwarden-directory-connector = {
description = "Sync timer for Bitwarden Directory Connector";
wantedBy = ["timers.target"];
after = ["network-online.target"];
timerConfig = {
OnCalendar = cfg.interval;
Unit = "bitwarden_directory_connector.service";
Unit = "bitwarden-directory-connector.service";
Persistent = true;
};
};
services.bitwarden_directory_connector = {
services.bitwarden-directory-connector = {
description = "Main process for Bitwarden Directory Connector";
path = [pkgs.jq];
@ -277,7 +283,7 @@ in {
Type = "oneshot";
User = "${cfg.user}";
PrivateTmp = true;
ExecStartPre = pkgs.writeShellScript "bitwarden_directory_connector-config" ''
preStart = ''
set -eo pipefail
# create the config file