Skip to content

Commit 7cf75f7

Browse files
2025 06 05
1 parent c08bad8 commit 7cf75f7

File tree

11 files changed

+1122
-268
lines changed

11 files changed

+1122
-268
lines changed

desktop/l/Makefile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,4 +57,16 @@ update_oldm.:
5757
restart_display_manager:
5858
sudo systemctl restart display-manager.service
5959

60+
#ls -l /run/opengl-driver/lib/gbm/
61+
#readlink /run/opengl-driver/lib/gbm/dri_gbm.so
62+
#glxinfo | grep -i 'renderer'
63+
64+
#journalctl -b | grep -Ei 'X.*fatal|gdm|wayland|mesa|amdgpu' --no-pager
65+
#less /var/log/Xorg.0.log
66+
67+
#nix-shell -p mesa-demos
68+
#glxinfo | grep -i opengl
69+
70+
# cat configuration.nix | grep -A 20 "hardware.graphics ="
71+
6072
# end

desktop/l/configuration.nix

Lines changed: 46 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,13 @@
1616
...
1717
}:
1818

19-
# https://nixos.wiki/wiki/FAQ#How_can_I_install_a_package_from_unstable_while_remaining_on_the_stable_channel.3F
20-
# https://discourse.nixos.org/t/differences-between-nix-channels/13998
21-
2219
{
2320
# https://nixos.wiki/wiki/NixOS_modules
2421
# https://nixos-and-flakes.thiscute.world/nixos-with-flakes/start-using-home-manager
2522
imports =
2623
[
2724
./hardware-configuration.nix
28-
./hardware-graphics.nix
25+
#./hardware-graphics.nix
2926
./sysctl.nix
3027
./wireless_desktop.nix
3128
./locale.nix
@@ -43,6 +40,7 @@
4340
./docker-daemon.nix
4441
#./smokeping.nix
4542
./distributed-builds.nix
43+
./hyprland.nix
4644
];
4745

4846
boot = {
@@ -56,8 +54,8 @@
5654

5755
# https://nixos.wiki/wiki/Linux_kernel
5856
#kernelPackages = pkgs.linuxPackages; # need to run this old kernel to allow nvidia driver to compile :(
59-
kernelPackages = pkgs.unstable.linuxPackages;
60-
#boot.kernelPackages = pkgs.linuxPackages_latest;
57+
#kernelPackages = pkgs.linuxPackages;
58+
kernelPackages = pkgs.linuxPackages_latest;
6159
#boot.kernelPackages = pkgs.linuxPackages_rpi4
6260

6361
# # https://github.com/tolgaerok/nixos-2405-gnome/blob/main/core/boot/efi/efi.nix#L56C5-L56C21
@@ -68,6 +66,10 @@
6866
# #"nomodeset"
6967
# ];
7068

69+
initrd.kernelModules = [
70+
"amdgpu"
71+
];
72+
7173
blacklistedKernelModules = [
7274
"nouveau"
7375
#"i915"
@@ -79,7 +81,6 @@
7981

8082
extraModulePackages = [
8183
config.boot.kernelPackages.v4l2loopback
82-
#pkgs.unstable.linuxPackages.nvidiaPackages.production
8384
];
8485

8586
extraModprobeConfig = ''
@@ -91,7 +92,7 @@
9192
# https://fzakaria.com/2025/02/26/nix-pragmatism-nix-ld-and-envfs
9293
# Enable nix-ld for better compatibility with non-Nix binaries
9394
programs.nix-ld = {
94-
enable = false;
95+
enable = true;
9596
# Add commonly needed libraries
9697
libraries = with pkgs; [
9798
stdenv.cc.cc.lib
@@ -103,7 +104,7 @@
103104

104105
# Enable envfs for better compatibility with FHS expectations
105106
services.envfs = {
106-
enable = false;
107+
enable = true;
107108
};
108109

109110
# For OBS
@@ -131,8 +132,8 @@
131132
services.udev.packages = [ pkgs.gnome-settings-daemon ];
132133
# services.udev.packages = [ pkgs.gnome.gnome-settings-daemon ];
133134

134-
# https://nixos.wiki/wiki/NixOS_Wiki:Audio
135-
hardware.pulseaudio.enable = false; # Use Pipewire, the modern sound subsystem
135+
# # https://nixos.wiki/wiki/NixOS_Wiki:Audio
136+
# services.pulseaudio.enable = false; # Use Pipewire, the modern sound subsystem
136137

137138
security.rtkit.enable = true; # Enable RealtimeKit for audio purposes
138139

@@ -182,7 +183,6 @@
182183
environment.sessionVariables = {
183184
TERM = "xterm-256color";
184185
#MY_VARIABLE = "my-value";
185-
#ANOTHER_VARIABLE = "another-value";
186186
};
187187

188188
users.users.das = {
@@ -209,35 +209,44 @@
209209
enableSSHSupport = true;
210210
};
211211

212-
# # https://wiki.hyprland.org/Nix/Hyprland-on-NixOS/
213-
programs.hyprland = {
212+
hardware.graphics = {
213+
enable = true; # auto includes mesa
214+
package = pkgs.mesa;
215+
extraPackages = with pkgs; [
216+
libglvnd
217+
libva-vdpau-driver
218+
libvdpau-va-gl
219+
rocmPackages.clr.icd
220+
];
221+
};
222+
services.xserver = {
223+
enable = true;
224+
videoDrivers = [ "amdgpu" ];
225+
xkb = {
226+
layout = "us";
227+
variant = "";
228+
};
229+
};
230+
231+
services.desktopManager.gnome.enable = true;
232+
services.displayManager.gdm.enable = true;
233+
234+
# https://nixos.wiki/wiki/AMD_GPU
235+
systemd.tmpfiles.rules = [
236+
"L+ /opt/rocm/hip - - - - ${pkgs.rocmPackages.clr}"
237+
];
238+
systemd.services.lactd.wantedBy = [ "multi-user.target" ];
239+
240+
xdg.portal = {
214241
enable = true;
215-
# Nvidia patches are no longer needed
216-
#nvidiaPatches = true;
217-
xwayland.enable = true;
242+
extraPortals = with pkgs; [ xdg-desktop-portal-gtk ];
243+
config.common.default = "gtk";
218244
};
245+
246+
# # https://wiki.hyprland.org/Nix/Hyprland-on-NixOS/
219247
# programs.hyprland = {
220248
# enable = true;
221-
# # set the flake package
222-
# package = inputs.hyprland.packages.${pkgs.stdenv.hostPlatform.system}.hyprland;
223-
# # make sure to also set the portal package, so that they are in sync
224-
# portalPackage = inputs.hyprland.packages.${pkgs.stdenv.hostPlatform.system}.xdg-desktop-portal-hyprland;
225-
# };
226-
227-
# programs.chromium.enable = true;
228-
# # programs.chromium.package = pkgs.google-chrome;
229-
# # https://nixos.wiki/wiki/Chromium#Enabling_native_Wayland_support
230-
# nixpkgs.config.chromium.commandLineArgs = "--enable-features=UseOzonePlatform --ozone-platform=wayland";
231-
# #programs.chromium.commandLineArgs = "--enable-features=UseOzonePlatform --ozone-platform=wayland";
232-
233-
# programs.firefox.enable = true;
234-
# # # https://github.com/TLATER/dotfiles/blob/master/nixos-modules/nvidia/default.nix
235-
# programs.firefox.preferences = {
236-
# "media.ffmpeg.vaapi.enabled" = true;
237-
# "media.rdd-ffmpeg.enabled" = true;
238-
# "media.av1.enabled" = true; # Won't work on the 2060
239-
# "gfx.x11-egl.force-enabled" = true;
240-
# "widget.dmabuf.force-enabled" = true;
249+
# xwayland.enable = true;
241250
# };
242251

243252
# Open ports in the firewall.
@@ -277,32 +286,10 @@
277286

278287
# https://wiki.nixos.org/wiki/Laptop
279288

280-
# This value determines the NixOS release from which the default
281-
# settings for stateful data, like file locations and database versions
282-
# on your system were taken. It's perfectly fine and recommended to leave
283-
# this value at the release version of the first install of this system.
284-
# Before changing this value read the documentation for this option
285-
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
286-
#system.stateVersion = "23.11";
287-
288289
system.stateVersion = "24.11";
289290

290291
nixpkgs.config = {
291292
allowUnfree = true;
292-
# allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [
293-
# "nvidia-x11"
294-
# "nvidia-settings"
295-
# "nvidia-persistenced"
296-
# ];
297293
};
298294

299-
# hardware.opengl = {
300-
# enable = true;
301-
# driSupport = true;
302-
# driSupport32Bit = true;
303-
# extraPackages = with pkgs; [
304-
# vaapiVdpau
305-
# libvdpau-va-gl
306-
# ];
307-
# };
308295
}

0 commit comments

Comments
 (0)