From 14cef2b1ee1884a9e332b57d0a6924f1ec2f2357 Mon Sep 17 00:00:00 2001 From: Jonni Liljamo Date: Sat, 20 Jul 2024 16:18:26 +0300 Subject: [PATCH] feat(roles/nvidia, roles/plasma, hosts/alice): nvidia, plasma, alice setup --- hosts/alice/default.nix | 14 +++++++++++++- roles/default.nix | 2 ++ roles/nvidia.nix | 31 +++++++++++++++++++++++++++++++ roles/plasma.nix | 27 +++++++++++++++++++++++++++ 4 files changed, 73 insertions(+), 1 deletion(-) create mode 100644 roles/nvidia.nix create mode 100644 roles/plasma.nix diff --git a/hosts/alice/default.nix b/hosts/alice/default.nix index 906f9f0..1ba4a0e 100644 --- a/hosts/alice/default.nix +++ b/hosts/alice/default.nix @@ -13,7 +13,7 @@ }; }; - #roles.audio.enable = true; + roles.audio.enable = true; roles.git = { enable = true; @@ -28,4 +28,16 @@ smtpserverport = 465 ''; }; + + roles.shell.enable = true; + roles.zellij.enable = true; + roles.kitty.enable = true; + + roles.nvidia.enable = true; + roles.plasma = { + enable = true; + enableHDR = true; + }; + + roles.steam.enable = true; } diff --git a/roles/default.nix b/roles/default.nix index b461751..e273bd1 100644 --- a/roles/default.nix +++ b/roles/default.nix @@ -7,6 +7,8 @@ ./hyprland.nix ./kitty.nix ./nix.nix + ./nvidia.nix + ./plasma.nix ./qutebrowser.nix ./shell.nix ./steam.nix diff --git a/roles/nvidia.nix b/roles/nvidia.nix new file mode 100644 index 0000000..1e79f45 --- /dev/null +++ b/roles/nvidia.nix @@ -0,0 +1,31 @@ +{ + config, + lib, + ... +}: let + cfg = config.roles.nvidia; +in { + options.roles.nvidia = { + enable = lib.mkEnableOption "NVIDIA drivers"; + }; + + config = lib.mkIf cfg.enable { + arta.unfree.allow = ["nvidia-x11"]; + + services.xserver.videoDrivers = ["nvidia"]; + + hardware.opengl = { + enable = true; + driSupport = true; + driSupport32Bit = true; + }; + + hardware.nvidia = { + modesetting.enable = true; + powerManagement.enable = true; + open = true; + nvidiaSettings = false; + }; + boot.kernelParams = ["nvidia-drm.fbdev=1"]; + }; +} diff --git a/roles/plasma.nix b/roles/plasma.nix new file mode 100644 index 0000000..da223cb --- /dev/null +++ b/roles/plasma.nix @@ -0,0 +1,27 @@ +{ + config, + lib, + pkgs, + ... +}: let + cfg = config.roles.plasma; +in { + options.roles.plasma = { + enable = lib.mkEnableOption "KDE Plasma"; + }; + + config = lib.mkIf cfg.enable { + services.displayManager = { + defaultSession = "plasma"; + sddm = { + enable = true; + wayland.enable = true; + }; + }; + services.desktopManager.plasma6.enable = true; + + environment.plasma6.excludePackages = with pkgs.kdePackages; [ + konsole + ]; + }; +} -- 2.44.1