hardware.legion: fix

This commit is contained in:
2024-03-25 11:40:13 +08:00
parent 3d08a3b498
commit 5e648574fb
2 changed files with 6 additions and 11 deletions

View File

@@ -62,6 +62,7 @@ inputs:
{
cpus = [ "amd" ];
gpu = { type = "amd+nvidia"; prime.busId = { amd = "8:0:0"; nvidia = "1:0:0"; }; dynamicBoost = true; };
legion = {};
};
packages.packageSet = "workstation";
virtualization =

View File

@@ -1,16 +1,10 @@
inputs:
{
options.nixos.hardware.legion = let inherit (inputs.lib) mkOption types; in
options.nixos.hardware.legion = let inherit (inputs.lib) mkOption types; in mkOption
{ type = types.nullOr (types.submodule {}); default = null; };
config = let inherit (inputs.config.nixos.hardware) legion; in inputs.lib.mkIf (legion != null)
{
enable = mkOption { type = types.bool; default = false; };
environment.systemPackages = [ inputs.pkgs.lenovo-legion ];
boot.extraModulePackages = [ inputs.config.boot.kernelPackages.lenovo-legion-module ];
};
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 ];
};
}