[skip ci] feat: some more changes based on https://github.com/NixOS/nixpkgs/pull/265783

This commit is contained in:
silver 2023-12-30 10:38:31 +00:00
parent a19d1cc915
commit 5900c41ab7
3 changed files with 54 additions and 57 deletions

View file

@ -7,12 +7,11 @@
pkg-config,
libsecret,
nodejs_18,
}: let
buildNpmPackage' = buildNpmPackage.override {nodejs = nodejs_18;};
in
buildNpmPackage' rec {
pname = "bitwarden-directory-connector";
}:
buildNpmPackage rec {
pname = "bitwarden-directory-connector-cli";
version = "2023.10.0";
nodejs = nodejs_18;
src = fetchFromGitHub {
owner = "bitwarden";
@ -44,7 +43,7 @@ in
postInstall = ''
chmod +x $out/libexec/bitwarden-directory-connector/build-cli/bwdc.js
mkdir -p $out/bin
ln -s $out/libexec/bitwarden-directory-connector/build-cli/bwdc.js $out/bin/bitwarden-directory-connector
ln -s $out/libexec/bitwarden-directory-connector/build-cli/bwdc.js $out/bin/bitwarden-directory-connector-cli
'';
buildInputs = [
@ -62,6 +61,6 @@ in
license = licenses.gpl3Only;
maintainers = with maintainers; [Silver-Golden];
platforms = platforms.linux;
mainProgram = "bitwarden-directory-connector";
mainProgram = "bitwarden-directory-connector-cli";
};
}
}

View file

@ -5,12 +5,12 @@
...
}:
with lib; let
cfg = config.services.bitwarden-directory-connector;
cfg = config.services.bitwarden-directory-connector-cli;
in {
options.services.bitwarden-directory-connector = {
options.services.bitwarden-directory-connector-cli = {
enable = mkEnableOption "Bitwarden Directory Connector";
package = mkPackageOption pkgs "bitwarden-directory-connector" {};
package = mkPackageOption pkgs "bitwarden-directory-connector-cli" {};
domain = mkOption {
type = types.str;
@ -36,7 +36,6 @@ in {
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 ({
config,
options,
@ -110,7 +109,6 @@ in {
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 ({
config,
options,
@ -259,18 +257,18 @@ in {
};
systemd = {
timers.bitwarden-directory-connector = {
timers.bitwarden-directory-connector-cli = {
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-cli.service";
Persistent = true;
};
};
services.bitwarden-directory-connector = {
services.bitwarden-directory-connector-cli = {
description = "Main process for Bitwarden Directory Connector";
path = [pkgs.jq];

View file

@ -29,7 +29,7 @@ in {
group = user;
};
services.bitwarden-directory-connector = {
services.bitwarden-directory-connector-cli = {
enable = true;
user = user;