system: add config for networking and hardware
This commit is contained in:
parent
eb64f25717
commit
e811bea33d
8 changed files with 118 additions and 17 deletions
20
modules/system/hardware/bluetooth.nix
Normal file
20
modules/system/hardware/bluetooth.nix
Normal file
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
}: let
|
||||
cfg = config.modules.system.hardware.bluetooth;
|
||||
inherit (config.modules.other.system) username;
|
||||
inherit (lib) mkIf;
|
||||
in {
|
||||
confg = mkIf cfg.enable {
|
||||
hardware.bluetooth = {
|
||||
enable = true;
|
||||
powerOnBoot = mkIf cfg.powerOnBoot true;
|
||||
};
|
||||
|
||||
home-manager.users.${username}.home.Packages = with pkgs; [
|
||||
bluetuith
|
||||
];
|
||||
};
|
||||
}
|
36
modules/system/hardware/graphics.nix
Normal file
36
modules/system/hardware/graphics.nix
Normal file
|
@ -0,0 +1,36 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
cfg = config.modules.system.hardware;
|
||||
inherit (cfg) amd nvidia;
|
||||
inherit (lib) mkIf;
|
||||
in {
|
||||
config = {
|
||||
hardware = {
|
||||
graphics = {
|
||||
enable = true;
|
||||
extraPackages = with pkgs;
|
||||
mkIf amd.enable [
|
||||
mesa
|
||||
libva
|
||||
vaapiVdpau
|
||||
];
|
||||
};
|
||||
};
|
||||
nvidia = mkIf nvidia.enable {
|
||||
modesetting.enable = true;
|
||||
open = false;
|
||||
powerManagement = {
|
||||
enable = true;
|
||||
finegrained = false;
|
||||
nvidiaSettings = false;
|
||||
package = config.boot.kernelPackges.nvidiaPackages.beta;
|
||||
};
|
||||
};
|
||||
boot.initrd.kernelModules = mkIf amd.enable ["amdgpu"];
|
||||
services.xserver.videoDrivers = mkIf nvidia.enable ["nvidia"];
|
||||
};
|
||||
}
|
0
modules/system/hardware/module.nix
Normal file
0
modules/system/hardware/module.nix
Normal file
0
modules/system/hardware/wifi.nix
Normal file
0
modules/system/hardware/wifi.nix
Normal file
Loading…
Add table
Add a link
Reference in a new issue