fix: remove wrapper

This commit is contained in:
sinavir 2024-07-19 15:31:35 +02:00
parent 675453d43a
commit 183111ea58

View file

@ -1,10 +1,10 @@
{ pkgs, config, lib, ... }: { pkgs, config, lib, ... }:
let let
cfg = config.services.signal-irc-bridge; cfg = config.services.signal-irc-bridge;
mkSystemdRunOptions = opts: lib.escapeShellArgs (lib.mapAttrsToList (k: v: "-p${k}=${builtins.toString v}") opts);
commonServiceOptions = { commonServiceOptions = {
DynamicUser = true; DynamicUser = true;
User = "signal-irc-client"; User = "signal-irc-client";
Group = "nginx";
StateDirectory = "signal-cli"; StateDirectory = "signal-cli";
RuntimeDirectory = "signal-cli"; RuntimeDirectory = "signal-cli";
@ -23,12 +23,6 @@ let
RuntimeDirectoryMode="0750"; RuntimeDirectoryMode="0750";
StateDirectoryMode="0750"; StateDirectoryMode="0750";
}; };
signal-cli-bridge-wrapper = pkgs.writeShellApplication {
name = "signal-cli-bridge-wrapper";
text = ''
systemd-run ${mkSystemdRunOptions commonServiceOptions} --pty --pipe --unit="signal-cli-bridge" ${lib.getExe pkgs.signal-cli} --config "\''${STATE_DIRECTORY}"/signal-cli-config/ "$@"
'';
};
in { in {
options = { options = {
services.signal-irc-bridge = { services.signal-irc-bridge = {
@ -45,7 +39,6 @@ in {
}; };
config = { config = {
nixpkgs.overlays = [ nixpkgs.overlays = [
(import ./overlay.nix) (import ./overlay.nix)
]; ];
@ -79,7 +72,7 @@ in {
}; };
}; };
environment.systemPackages = lib.mkIf cfg.enable [ environment.systemPackages = lib.mkIf cfg.enable [
signal-cli-bridge-wrapper pkgs.signal-cli
]; ];
}; };
} }