feat: move nvidia to module option; re-org driver modules
This commit is contained in:
parent
99623ce473
commit
ee90d3577f
8 changed files with 22 additions and 17 deletions
|
@ -15,8 +15,11 @@ in {
|
|||
|
||||
marleyos = {
|
||||
profiles = {
|
||||
desktop = enabled;
|
||||
hardware.nvidia = enabled;
|
||||
desktop = true;
|
||||
};
|
||||
|
||||
hardware = {
|
||||
nvidia = enabled;
|
||||
};
|
||||
|
||||
mounts.babeshare = enabled;
|
||||
|
|
|
@ -4,10 +4,6 @@ in {
|
|||
marleyos = {
|
||||
profiles = {
|
||||
inherit (cfg.profiles) desktop server;
|
||||
|
||||
hardware = {
|
||||
inherit (cfg.profiles.hardware) nvidia;
|
||||
};
|
||||
};
|
||||
|
||||
my = {
|
||||
|
|
|
@ -5,5 +5,6 @@
|
|||
../base
|
||||
|
||||
./base
|
||||
./hardware
|
||||
];
|
||||
}
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
{
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
config = lib.mkIf (!config.marleyos.profiles.server) {
|
||||
security.rtkit.enable = true; # Used for pulseaudio.
|
||||
security.rtkit.enable = true; # for pulseaudio
|
||||
|
||||
hardware.pulseaudio.enable = false;
|
||||
|
||||
|
@ -15,8 +15,6 @@
|
|||
alsa.enable = true;
|
||||
pulse.enable = true;
|
||||
};
|
||||
|
||||
printing.enable = true;
|
||||
};
|
||||
|
||||
environment.systemPackages = [pkgs.pwvucontrol];
|
8
modules/nixos/hardware/default.nix
Normal file
8
modules/nixos/hardware/default.nix
Normal file
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
imports = [
|
||||
./audio.nix
|
||||
./nvidia.nix
|
||||
|
||||
./misc.nix # try to use this as little as possible
|
||||
];
|
||||
}
|
3
modules/nixos/hardware/misc.nix
Normal file
3
modules/nixos/hardware/misc.nix
Normal file
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
services.printing.enable = true;
|
||||
}
|
|
@ -3,9 +3,9 @@
|
|||
config,
|
||||
...
|
||||
}: let
|
||||
cfg = config.marleyos.nvidia;
|
||||
cfg = config.marleyos.hardware.nvidia;
|
||||
in {
|
||||
options.marleyos.nvidia.enable = lib.mkEnableOption "nvidia";
|
||||
options.marleyos.hardware.nvidia.enable = lib.mkEnableOption "nvidia";
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
# NVIDIA drivers are unfree.
|
|
@ -2,9 +2,5 @@
|
|||
options.marleyos.profiles = {
|
||||
desktop = lib.mkEnableOption "graphical desktop profile";
|
||||
server = lib.mkEnableOption "server profile";
|
||||
|
||||
hardware = {
|
||||
nvidia = lib.mkEnableOption "Nvidia profile";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue