Added configuration for desktop
This commit is contained in:
38
modules/system/desktop/nvidia.nix
Normal file
38
modules/system/desktop/nvidia.nix
Normal file
@@ -0,0 +1,38 @@
|
||||
{ config, lib, pkgs, nixpkgs, ... }:
|
||||
|
||||
{
|
||||
nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [
|
||||
"nvidia-x11"
|
||||
"nvidia-settings"
|
||||
];
|
||||
hardware.opengl = {
|
||||
enable = true;
|
||||
driSupport = true;
|
||||
driSupport32Bit = true;
|
||||
};
|
||||
|
||||
services.xserver.videoDrivers = ["nvidia"]; # or "nvidiaLegacy470 etc.
|
||||
|
||||
hardware.nvidia = {
|
||||
|
||||
modesetting.enable = true;
|
||||
|
||||
powerManagement.enable = false;
|
||||
|
||||
# Fine-grained power management. Turns off GPU when not in use.
|
||||
# Experimental and only works on modern Nvidia GPUs (Turing or newer).
|
||||
powerManagement.finegrained = false;
|
||||
|
||||
# Use the NVidia open source kernel module (not to be confused with the
|
||||
# independent third-party "nouveau" open source driver).
|
||||
# Support is limited to the Turing and later architectures. Full list of
|
||||
# supported GPUs is at:
|
||||
# https://github.com/NVIDIA/open-gpu-kernel-modules#compatible-gpus
|
||||
# Only available from driver 515.43.04+
|
||||
# Currently alpha-quality/buggy, so false is currently the recommended setting.
|
||||
open = false;
|
||||
nvidiaSettings = true;
|
||||
|
||||
package = config.boot.kernelPackages.nvidiaPackages.stable;
|
||||
};
|
||||
}
|
19
modules/system/desktop/plasma.nix
Normal file
19
modules/system/desktop/plasma.nix
Normal file
@@ -0,0 +1,19 @@
|
||||
{ ... }:
|
||||
|
||||
{
|
||||
services.xserver.enable = true;
|
||||
services.xserver.displayManager.sddm.enable = true;
|
||||
services.xserver.desktopManager.plasma5.enable = true;
|
||||
|
||||
sound.enable = true;
|
||||
hardware.pulseaudio.enable = false;
|
||||
security.rtkit.enable = true;
|
||||
services.pipewire = {
|
||||
enable = true;
|
||||
alsa.enable = true;
|
||||
alsa.support32Bit = true;
|
||||
pulse.enable = true;
|
||||
};
|
||||
|
||||
programs.dconf.enable = true;
|
||||
}
|
25
modules/system/programs/sunshine.nix
Normal file
25
modules/system/programs/sunshine.nix
Normal file
@@ -0,0 +1,25 @@
|
||||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
environment.systemPackages = with pkgs; [
|
||||
unstable.sunshine
|
||||
];
|
||||
|
||||
services.udev.extraRules = ''
|
||||
KERNEL=="uinput", SUBSYSTEM=="misc", OPTIONS+="static_node=uinput", TAG+="uaccess"
|
||||
'';
|
||||
|
||||
services.avahi = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
networking.firewall = {
|
||||
allowedTCPPorts = [ 48010 ];
|
||||
allowedTCPPortRanges = [
|
||||
{ from = 47984; to = 47990; }
|
||||
];
|
||||
allowedUDPPortRanges = [
|
||||
{ from = 47998; to = 48000; }
|
||||
];
|
||||
};
|
||||
}
|
7
modules/system/utils/firewall.nix
Normal file
7
modules/system/utils/firewall.nix
Normal file
@@ -0,0 +1,7 @@
|
||||
{ ... }:
|
||||
|
||||
{
|
||||
networking.firewall = {
|
||||
enable = true;
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user