mirror of
https://github.com/CHN-beta/nixos.git
synced 2026-01-12 04:39:23 +08:00
hardware: disable some support for server
This commit is contained in:
@@ -57,6 +57,7 @@ inputs:
|
||||
kernel.patches = [ "cjktty" "hibernate-progress" ];
|
||||
networking.hostname = "pc";
|
||||
sysctl.laptop-mode = 5;
|
||||
gui.enable = true;
|
||||
};
|
||||
hardware =
|
||||
{
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 = []; };
|
||||
|
||||
@@ -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; };
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user