forked from tadeokondrak/wineusbdm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnixos-module.nix
36 lines (34 loc) · 862 Bytes
/
nixos-module.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
self:
{
inputs,
config,
lib,
pkgs,
...
}:
let
cfg = config.hardware.usbdm;
usbdmPackage = self.inputs.usbdm-flake.packages.${pkgs.stdenv.hostPlatform.system}.default;
defaultPackage = self.packages.${pkgs.stdenv.hostPlatform.system}.wineusbdm;
in
{
options.hardware.usbdm = {
enable = lib.mkEnableOption "Whether or not to enable USBDM.";
package = lib.mkOption {
type = with lib.types; nullOr package;
default = usbdmPackage;
};
wineLibPackage = lib.mkOption {
type = with lib.types; nullOr package;
default = defaultPackage;
};
udev = lib.mkEnableOption "Whether to add the udev rules for USBDM.";
};
config = lib.mkIf cfg.enable {
environment.systemPackages = [
cfg.package
cfg.wineLibPackage
];
services.udev.packages = lib.mkIf cfg.udev [ cfg.package ];
};
}