nixos/usbmuxd: Ability to change package

This commit is contained in:
Jonas Heinrich 2022-12-07 10:58:55 +01:00 committed by Yt
parent a518020cc4
commit a9e3b1c0f2
3 changed files with 23 additions and 1 deletions

View File

@ -209,6 +209,16 @@
<link linkend="opt-services.opensnitch.rules">services.opensnitch.rules</link>
</para>
</listitem>
<listitem>
<para>
The module <literal>usbmuxd</literal> now has the ability to
change the package used by the daemon. In case youre
experiencing issues with <literal>usbmuxd</literal> you can
try an alternative program like <literal>usbmuxd2</literal>.
Available as
<link linkend="opt-services.usbmuxd.package">services.usbmuxd.package</link>
</para>
</listitem>
<listitem>
<para>
<literal>services.mastodon</literal> gained a tootctl wrapped

View File

@ -61,6 +61,8 @@ In addition to numerous new and upgraded packages, this release has the followin
- The module for the application firewall `opensnitch` got the ability to configure rules. Available as [services.opensnitch.rules](#opt-services.opensnitch.rules)
- The module `usbmuxd` now has the ability to change the package used by the daemon. In case you're experiencing issues with `usbmuxd` you can try an alternative program like `usbmuxd2`. Available as [services.usbmuxd.package](#opt-services.usbmuxd.package)
- `services.mastodon` gained a tootctl wrapped named `mastodon-tootctl` similar to `nextcloud-occ` which can be executed from any user and switches to the configured mastodon user with sudo and sources the environment variables.
- The `dnsmasq` service now takes configuration via the

View File

@ -13,6 +13,7 @@ in
{
options.services.usbmuxd = {
enable = mkOption {
type = types.bool;
default = false;
@ -39,6 +40,15 @@ in
The group usbmuxd should use to run after startup.
'';
};
package = mkOption {
type = types.package;
default = pkgs.usbmuxd;
defaultText = literalExpression "pkgs.usbmuxd";
description = lib.mdDoc "Which package to use for the usbmuxd daemon.";
relatedPackages = [ "usbmuxd" "usbmuxd2" ];
};
};
config = mkIf cfg.enable {
@ -68,7 +78,7 @@ in
# Trigger the udev rule manually. This doesn't require replugging the
# device when first enabling the option to get it to work
ExecStartPre = "${pkgs.udev}/bin/udevadm trigger -s usb -a idVendor=${apple}";
ExecStart = "${pkgs.usbmuxd}/bin/usbmuxd -U ${cfg.user} -f";
ExecStart = "${cfg.package}/bin/usbmuxd -U ${cfg.user} -v";
};
};