mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-09 19:13:26 +03:00

After final improvements to the official formatter implementation, this commit now performs the first treewide reformat of Nix files using it. This is part of the implementation of RFC 166. Only "inactive" files are reformatted, meaning only files that aren't being touched by any PR with activity in the past 2 months. This is to avoid conflicts for PRs that might soon be merged. Later we can do a full treewide reformat to get the rest, which should not cause as many conflicts. A CI check has already been running for some time to ensure that new and already-formatted files are formatted, so the files being reformatted here should also stay formatted. This commit was automatically created and can be verified using nix-builda08b3a4d19
.tar.gz \ --argstr baseRevb32a094368
result/bin/apply-formatting $NIXPKGS_PATH
48 lines
1.4 KiB
Nix
48 lines
1.4 KiB
Nix
{
|
|
config,
|
|
lib,
|
|
pkgs,
|
|
...
|
|
}:
|
|
{
|
|
###### interface
|
|
|
|
options = {
|
|
|
|
hardware.usb-modeswitch = {
|
|
enable = lib.mkOption {
|
|
type = lib.types.bool;
|
|
default = false;
|
|
description = ''
|
|
Enable this option to support certain USB WLAN and WWAN adapters.
|
|
|
|
These network adapters initial present themselves as Flash Drives containing their drivers.
|
|
This option enables automatic switching to the networking mode.
|
|
'';
|
|
};
|
|
};
|
|
};
|
|
|
|
###### implementation
|
|
|
|
imports = [
|
|
(lib.mkRenamedOptionModule [ "hardware" "usbWwan" ] [ "hardware" "usb-modeswitch" ])
|
|
];
|
|
|
|
config = lib.mkIf config.hardware.usb-modeswitch.enable {
|
|
# Attaches device specific handlers.
|
|
services.udev.packages = with pkgs; [ usb-modeswitch-data ];
|
|
|
|
# Triggered by udev, usb-modeswitch creates systemd services via a
|
|
# template unit in the usb-modeswitch package.
|
|
systemd.packages = with pkgs; [ usb-modeswitch ];
|
|
|
|
# The systemd service requires the usb-modeswitch-data. The
|
|
# usb-modeswitch package intends to discover this via the
|
|
# filesystem at /usr/share/usb_modeswitch, and merge it with user
|
|
# configuration in /etc/usb_modeswitch.d. Configuring the correct
|
|
# path in the package is difficult, as it would cause a cyclic
|
|
# dependency.
|
|
environment.etc."usb_modeswitch.d".source = "${pkgs.usb-modeswitch-data}/share/usb_modeswitch";
|
|
};
|
|
}
|