hardware: disable some support for server

This commit is contained in:
2024-04-25 17:55:57 +08:00
parent 6d237e3b90
commit f5a153d1a3
7 changed files with 22 additions and 13 deletions

View File

@@ -57,6 +57,7 @@ inputs:
kernel.patches = [ "cjktty" "hibernate-progress" ];
networking.hostname = "pc";
sysctl.laptop-mode = 5;
gui.enable = true;
};
hardware =
{

View File

@@ -33,6 +33,7 @@ inputs:
nix.substituters = [ "https://cache.nixos.org/" "https://nix-store.chn.moe" ];
kernel = { variant = "xanmod-lts"; patches = [ "cjktty" "lantian" "surface" ]; };
networking.hostname = "surface";
gui.enable = true;
};
hardware = { cpus = [ "intel" ]; gpu.type = "intel"; };
packages.packageSet = "desktop-extra";

View File

@@ -47,7 +47,7 @@ inputs:
forwardCompat = false;
};
};
gui = { preferred = false; autoStart = true; };
gui = { enable = true; preferred = false; autoStart = true; };
networking.hostname = "xmupc1";
nix.remote.slave.enable = true;
};

View File

@@ -41,7 +41,7 @@ inputs:
forwardCompat = false;
};
};
gui = { preferred = false; autoStart = true; };
gui = { enable = true; preferred = false; autoStart = true; };
networking.hostname = "xmupc2";
nix.remote.slave.enable = true;
};

View File

@@ -1,14 +1,18 @@
inputs:
{
imports = inputs.localLib.findModules ./.;
options.nixos.hardware = let inherit (inputs.lib) mkOption types; in
{
bluetooth = mkOption { type = types.nullOr (types.submodule {}); default = {}; };
joystick = mkOption { type = types.nullOr (types.submodule {}); default = {}; };
printer = mkOption { type = types.nullOr (types.submodule {}); default = {}; };
sound = mkOption { type = types.nullOr (types.submodule {}); default = {}; };
cpus = mkOption { type = types.listOf (types.enum [ "intel" "amd" ]); default = []; };
};
options.nixos.hardware =
let
inherit (inputs.lib) mkOption types;
default = if inputs.config.nixos.system.gui.enable then {} else null;
in
{
bluetooth = mkOption { type = types.nullOr (types.submodule {}); inherit default; };
joystick = mkOption { type = types.nullOr (types.submodule {}); inherit default; };
printer = mkOption { type = types.nullOr (types.submodule {}); inherit default; };
sound = mkOption { type = types.nullOr (types.submodule {}); inherit default; };
cpus = mkOption { type = types.listOf (types.enum [ "intel" "amd" ]); default = []; };
};
config = let inherit (inputs.config.nixos) hardware; in inputs.lib.mkMerge
[
# bluetooth

View File

@@ -17,7 +17,11 @@ inputs:
];
in
{
packageSet = mkOption { type = types.enum packageSets; default = "server"; };
packageSet = mkOption
{
type = types.enum packageSets;
default = if inputs.config.nixos.system.gui.enable then "desktop" else "server";
};
extraPackages = mkOption { type = types.listOf types.unspecified; default = []; };
excludePackages = mkOption { type = types.listOf types.unspecified; default = []; };
extraPythonPackages = mkOption { type = types.listOf types.unspecified; default = []; };

View File

@@ -2,8 +2,7 @@ inputs:
{
options.nixos.system.gui = let inherit (inputs.lib) mkOption types; in
{
enable = mkOption
{ type = types.bool; default = builtins.elem "desktop" inputs.config.nixos.packages._packageSets; };
enable = mkOption { type = types.bool; default = false; };
preferred = mkOption { type = types.bool; default = inputs.config.nixos.system.gui.enable; };
autoStart = mkOption { type = types.bool; default = inputs.config.nixos.system.gui.preferred; };
};