hardware.legion: init

This commit is contained in:
陈浩南 2024-01-14 14:55:39 +08:00
parent c8e0c74535
commit 8ef28b9de5
3 changed files with 18 additions and 0 deletions

View File

@ -134,6 +134,7 @@
joystick.enable = true; joystick.enable = true;
printer.enable = true; printer.enable = true;
sound.enable = true; sound.enable = true;
legion.enable = true;
}; };
packages.packageSet = "workstation"; packages.packageSet = "workstation";
virtualization = virtualization =

View File

@ -1,5 +1,6 @@
inputs: inputs:
{ {
imports = inputs.localLib.mkModules [ ./legion.nix ];
options.nixos.hardware = let inherit (inputs.lib) mkOption types; in options.nixos.hardware = let inherit (inputs.lib) mkOption types; in
{ {
bluetooth.enable = mkOption { type = types.bool; default = false; }; bluetooth.enable = mkOption { type = types.bool; default = false; };

View File

@ -0,0 +1,16 @@
inputs:
{
options.nixos.hardware.legion = let inherit (inputs.lib) mkOption types; in
{
enable = mkOption { type = types.bool; default = false; };
};
config =
let
inherit (inputs.lib) mkIf;
inherit (inputs.config.nixos.hardware) legion;
in mkIf legion.enable
{
environment.systemPackages = [ inputs.pkgs.lenovo-legion ];
boot.extraModulePackages = [ inputs.config.boot.kernelPackages.lenovo-legion-module ];
};
}