mirror of
https://github.com/NixOS/nixos-hardware.git
synced 2026-11-30 21:13:30 +01:00
Extract "surface-control" management into new option-enabled module
This commit is contained in:
1 parent
0ce988ea8a
commit
f0835cb45c
3 files changed
+27
-8
No files matched your search
@@ -7,6 +7,7 @@ in {
|
||||
imports = [
|
||||
./kernel
|
||||
./ipts
|
||||
./surface-control
|
||||
];
|
||||
|
||||
microsoft-surface.kernelVersion = mkDefault "6.0.11";
|
||||
|
||||
@@ -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
|
||||
'';
|
||||
|
||||
environment.systemPackages = [
|
||||
pkgs.surface-control
|
||||
];
|
||||
users.groups.surface-control = { };
|
||||
services.udev.packages = [
|
||||
pkgs.surface-control
|
||||
];
|
||||
|
||||
microsoft-surface.surface-control.enable = true;
|
||||
microsoft-surface.ipts.enable = true;
|
||||
}
|
||||
Reference in new issue
Block a user