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

View file

@ -5,12 +5,12 @@
... ...
}: }:
with lib; let with lib; let
cfg = config.services.bitwarden-directory-connector; cfg = config.services.bitwarden-directory-connector-cli;
in { in {
options.services.bitwarden-directory-connector = { options.services.bitwarden-directory-connector-cli = {
enable = mkEnableOption "Bitwarden Directory Connector"; enable = mkEnableOption "Bitwarden Directory Connector";
package = mkPackageOption pkgs "bitwarden-directory-connector" {}; package = mkPackageOption pkgs "bitwarden-directory-connector-cli" {};
domain = mkOption { domain = mkOption {
type = types.str; 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`. 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 = {}; default = {};
type = types.submodule ({ type = types.submodule ({
config, config,
options, 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`. 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 = {}; default = {};
type = types.submodule ({ type = types.submodule ({
config, config,
options, options,
@ -259,18 +257,18 @@ in {
}; };
systemd = { systemd = {
timers.bitwarden-directory-connector = { timers.bitwarden-directory-connector-cli = {
description = "Sync timer for Bitwarden Directory Connector"; description = "Sync timer for Bitwarden Directory Connector";
wantedBy = ["timers.target"]; wantedBy = ["timers.target"];
after = ["network-online.target"]; after = ["network-online.target"];
timerConfig = { timerConfig = {
OnCalendar = cfg.interval; OnCalendar = cfg.interval;
Unit = "bitwarden-directory-connector.service"; Unit = "bitwarden-directory-connector-cli.service";
Persistent = true; Persistent = true;
}; };
}; };
services.bitwarden-directory-connector = { services.bitwarden-directory-connector-cli = {
description = "Main process for Bitwarden Directory Connector"; description = "Main process for Bitwarden Directory Connector";
path = [pkgs.jq]; path = [pkgs.jq];

View file

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