mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-13 21:50:33 +03:00
nixos/services.usbmuxd: remove with lib;
This commit is contained in:
parent
ab7b22c311
commit
a79aa024ca
1 changed files with 12 additions and 15 deletions
|
@ -1,7 +1,4 @@
|
||||||
{ config, lib, pkgs, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
with lib;
|
|
||||||
|
|
||||||
let
|
let
|
||||||
|
|
||||||
defaultUserGroup = "usbmux";
|
defaultUserGroup = "usbmux";
|
||||||
|
@ -14,8 +11,8 @@ in
|
||||||
{
|
{
|
||||||
options.services.usbmuxd = {
|
options.services.usbmuxd = {
|
||||||
|
|
||||||
enable = mkOption {
|
enable = lib.mkOption {
|
||||||
type = types.bool;
|
type = lib.types.bool;
|
||||||
default = false;
|
default = false;
|
||||||
description = ''
|
description = ''
|
||||||
Enable the usbmuxd ("USB multiplexing daemon") service. This daemon is
|
Enable the usbmuxd ("USB multiplexing daemon") service. This daemon is
|
||||||
|
@ -25,35 +22,35 @@ in
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
user = mkOption {
|
user = lib.mkOption {
|
||||||
type = types.str;
|
type = lib.types.str;
|
||||||
default = defaultUserGroup;
|
default = defaultUserGroup;
|
||||||
description = ''
|
description = ''
|
||||||
The user usbmuxd should use to run after startup.
|
The user usbmuxd should use to run after startup.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
group = mkOption {
|
group = lib.mkOption {
|
||||||
type = types.str;
|
type = lib.types.str;
|
||||||
default = defaultUserGroup;
|
default = defaultUserGroup;
|
||||||
description = ''
|
description = ''
|
||||||
The group usbmuxd should use to run after startup.
|
The group usbmuxd should use to run after startup.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
package = mkOption {
|
package = lib.mkOption {
|
||||||
type = types.package;
|
type = lib.types.package;
|
||||||
default = pkgs.usbmuxd;
|
default = pkgs.usbmuxd;
|
||||||
defaultText = literalExpression "pkgs.usbmuxd";
|
defaultText = lib.literalExpression "pkgs.usbmuxd";
|
||||||
description = "Which package to use for the usbmuxd daemon.";
|
description = "Which package to use for the usbmuxd daemon.";
|
||||||
relatedPackages = [ "usbmuxd" "usbmuxd2" ];
|
relatedPackages = [ "usbmuxd" "usbmuxd2" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
|
|
||||||
users.users = optionalAttrs (cfg.user == defaultUserGroup) {
|
users.users = lib.optionalAttrs (cfg.user == defaultUserGroup) {
|
||||||
${cfg.user} = {
|
${cfg.user} = {
|
||||||
description = "usbmuxd user";
|
description = "usbmuxd user";
|
||||||
group = cfg.group;
|
group = cfg.group;
|
||||||
|
@ -61,7 +58,7 @@ in
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
users.groups = optionalAttrs (cfg.group == defaultUserGroup) {
|
users.groups = lib.optionalAttrs (cfg.group == defaultUserGroup) {
|
||||||
${cfg.group} = { };
|
${cfg.group} = { };
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue