Extract "surface-control" management into new option-enabled module
This commit is contained in:
parent
b8f4e97171
commit
5b27563b02
|
@ -7,6 +7,7 @@ in {
|
||||||
imports = [
|
imports = [
|
||||||
./kernel
|
./kernel
|
||||||
./ipts
|
./ipts
|
||||||
|
./surface-control
|
||||||
];
|
];
|
||||||
|
|
||||||
microsoft-surface.kernelVersion = mkDefault "6.0.11";
|
microsoft-surface.kernelVersion = mkDefault "6.0.11";
|
||||||
|
|
25
microsoft/surface/common/surface-control/default.nix
Normal file
25
microsoft/surface/common/surface-control/default.nix
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
|
||||||
|
let
|
||||||
|
inherit (lib) mkDefault mkEnableOption mkIf mkMerge;
|
||||||
|
|
||||||
|
cfg = config.microsoft-surface.surface-control;
|
||||||
|
|
||||||
|
in {
|
||||||
|
options.microsoft-surface.surface-control = {
|
||||||
|
enable = mkEnableOption "Enable 'surface-control' for Microsoft Surface";
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkMerge [
|
||||||
|
{
|
||||||
|
microsoft-surface.surface-control.enable = mkDefault false;
|
||||||
|
}
|
||||||
|
|
||||||
|
(mkIf cfg.enable {
|
||||||
|
environment.systemPackages = with pkgs; [ surface-control ];
|
||||||
|
services.udev.packages = with pkgs; [ surface-control];
|
||||||
|
users.groups.surface-control = { };
|
||||||
|
})
|
||||||
|
];
|
||||||
|
}
|
|
@ -17,13 +17,6 @@ in {
|
||||||
options iwldvm force_cam=N
|
options iwldvm force_cam=N
|
||||||
'';
|
'';
|
||||||
|
|
||||||
environment.systemPackages = [
|
microsoft-surface.surface-control.enable = true;
|
||||||
pkgs.surface-control
|
|
||||||
];
|
|
||||||
users.groups.surface-control = { };
|
|
||||||
services.udev.packages = [
|
|
||||||
pkgs.surface-control
|
|
||||||
];
|
|
||||||
|
|
||||||
microsoft-surface.ipts.enable = true;
|
microsoft-surface.ipts.enable = true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue