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 = {
|
marleyos = {
|
||||||
profiles = {
|
profiles = {
|
||||||
desktop = enabled;
|
desktop = true;
|
||||||
hardware.nvidia = enabled;
|
};
|
||||||
|
|
||||||
|
hardware = {
|
||||||
|
nvidia = enabled;
|
||||||
};
|
};
|
||||||
|
|
||||||
mounts.babeshare = enabled;
|
mounts.babeshare = enabled;
|
||||||
|
|
|
@ -4,10 +4,6 @@ in {
|
||||||
marleyos = {
|
marleyos = {
|
||||||
profiles = {
|
profiles = {
|
||||||
inherit (cfg.profiles) desktop server;
|
inherit (cfg.profiles) desktop server;
|
||||||
|
|
||||||
hardware = {
|
|
||||||
inherit (cfg.profiles.hardware) nvidia;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
my = {
|
my = {
|
||||||
|
|
|
@ -5,5 +5,6 @@
|
||||||
../base
|
../base
|
||||||
|
|
||||||
./base
|
./base
|
||||||
|
./hardware
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
{
|
{
|
||||||
pkgs,
|
|
||||||
config,
|
|
||||||
lib,
|
lib,
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
...
|
...
|
||||||
}: {
|
}: {
|
||||||
config = lib.mkIf (!config.marleyos.profiles.server) {
|
config = lib.mkIf (!config.marleyos.profiles.server) {
|
||||||
security.rtkit.enable = true; # Used for pulseaudio.
|
security.rtkit.enable = true; # for pulseaudio
|
||||||
|
|
||||||
hardware.pulseaudio.enable = false;
|
hardware.pulseaudio.enable = false;
|
||||||
|
|
||||||
|
@ -15,8 +15,6 @@
|
||||||
alsa.enable = true;
|
alsa.enable = true;
|
||||||
pulse.enable = true;
|
pulse.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
printing.enable = true;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
environment.systemPackages = [pkgs.pwvucontrol];
|
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,
|
config,
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
cfg = config.marleyos.nvidia;
|
cfg = config.marleyos.hardware.nvidia;
|
||||||
in {
|
in {
|
||||||
options.marleyos.nvidia.enable = lib.mkEnableOption "nvidia";
|
options.marleyos.hardware.nvidia.enable = lib.mkEnableOption "nvidia";
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
# NVIDIA drivers are unfree.
|
# NVIDIA drivers are unfree.
|
|
@ -2,9 +2,5 @@
|
||||||
options.marleyos.profiles = {
|
options.marleyos.profiles = {
|
||||||
desktop = lib.mkEnableOption "graphical desktop profile";
|
desktop = lib.mkEnableOption "graphical desktop profile";
|
||||||
server = lib.mkEnableOption "server profile";
|
server = lib.mkEnableOption "server profile";
|
||||||
|
|
||||||
hardware = {
|
|
||||||
nvidia = lib.mkEnableOption "Nvidia profile";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue