✨ Moved modeules into shared
This commit is contained in:
33
shared/modules/hardware/audio.nix
Normal file
33
shared/modules/hardware/audio.nix
Normal file
@ -0,0 +1,33 @@
|
||||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
environment.systemPackages = with pkgs; [
|
||||
gst_all_1.gstreamer
|
||||
gst_all_1.gst-plugins-base
|
||||
gst_all_1.gst-plugins-good
|
||||
gst_all_1.gst-plugins-bad
|
||||
|
||||
wireplumber
|
||||
playerctl # Interaction with audioplayers and browsers
|
||||
pavucontrol # GUI
|
||||
spotify
|
||||
];
|
||||
|
||||
hardware.pulseaudio.enable = false; # Will be moved to services in 25.05
|
||||
|
||||
security.rtkit.enable = true; # Enable RealtimeKit for audio purposes
|
||||
|
||||
services = {
|
||||
pipewire = {
|
||||
enable = true;
|
||||
alsa = {
|
||||
enable = true;
|
||||
support32Bit = true;
|
||||
};
|
||||
pulse.enable = true;
|
||||
# Uncomment the following line if you want to use JACK applications
|
||||
# jack.enable = true;
|
||||
};
|
||||
# pulseaudio.enable = false; # TODO uncommenct at 25.05
|
||||
};
|
||||
}
|
7
shared/modules/hardware/default.nix
Normal file
7
shared/modules/hardware/default.nix
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
imports = [
|
||||
./audio.nix
|
||||
./graphics
|
||||
./keyboard.nix
|
||||
];
|
||||
}
|
8
shared/modules/hardware/graphics/default.nix
Normal file
8
shared/modules/hardware/graphics/default.nix
Normal file
@ -0,0 +1,8 @@
|
||||
{
|
||||
imports = [
|
||||
./nvidia.nix
|
||||
];
|
||||
|
||||
# Enable OpenGL
|
||||
hardware.graphics.enable = true;
|
||||
}
|
33
shared/modules/hardware/graphics/nvidia.nix
Normal file
33
shared/modules/hardware/graphics/nvidia.nix
Normal file
@ -0,0 +1,33 @@
|
||||
{
|
||||
pkgs,
|
||||
lib,
|
||||
systemConfig,
|
||||
...
|
||||
}:
|
||||
|
||||
lib.mkIf systemConfig.nvidia.enable {
|
||||
boot.kernelParams = [ "nvidia.NVreg_PreserveVideoMemoryAllocations=1" ];
|
||||
|
||||
# For hardware acceleration
|
||||
environment.sessionVariables.LIBVA_DRIVER_NAME = "nvidia";
|
||||
|
||||
hardware = {
|
||||
graphics.extraPackages = with pkgs; [
|
||||
# Used for hardware-acceleration
|
||||
nvidia-vaapi-driver
|
||||
];
|
||||
nvidia = {
|
||||
# Required
|
||||
modesetting.enable = true;
|
||||
# Use closed-source drivers
|
||||
open = false;
|
||||
# Enable the Nvidia settings menu
|
||||
nvidiaSettings = true;
|
||||
# Enable nvidia-suspend.service, nvidia-hibernate.service and nvidia-resume.service
|
||||
powerManagement.enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
# Load Nvidia driver for Xorg and Wayland
|
||||
services.xserver.videoDrivers = [ "nvidia" ];
|
||||
}
|
11
shared/modules/hardware/keyboard.nix
Normal file
11
shared/modules/hardware/keyboard.nix
Normal file
@ -0,0 +1,11 @@
|
||||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
environment.systemPackages = with pkgs; [
|
||||
via
|
||||
];
|
||||
|
||||
hardware.keyboard.qmk.enable = true;
|
||||
|
||||
services.udev.packages = with pkgs; [ via ];
|
||||
}
|
Reference in New Issue
Block a user