Last active
January 13, 2022 14:29
-
-
Save afreakk/1df21c564be3250579b8ed27dda10ad7 to your computer and use it in GitHub Desktop.
workaround for nvidia dbus errors for nix https://forums.developer.nvidia.com/t/bug-nvidia-v495-29-05-driver-spamming-dbus-enabled-applications-with-invalid-messages/192892/36
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ config, pkgs, ... }: | |
let | |
busName = "nvidia.powerd.server"; | |
userName = "messagebus"; | |
nvidiaBlackHole = pkgs.writeTextFile { | |
name = "nvidiaBlackHole"; | |
destination = "/etc/dbus-1/system.d/nvidia-fake-powerd.conf"; | |
text = '' | |
<!DOCTYPE busconfig PUBLIC | |
"-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN" | |
"http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd"> | |
<busconfig> | |
<policy user="${userName}"> | |
<allow own="${busName}"/> | |
</policy> | |
<policy context="default"> | |
<allow send_destination="${busName}"/> | |
<allow receive_sender="${busName}"/> | |
</policy> | |
</busconfig> | |
'';}; | |
in | |
{ | |
services.dbus.packages = [nvidiaBlackHole]; | |
systemd.services.nvidiaBlackHole = { | |
wantedBy = [ "default.target" ]; | |
aliases = ["dbus-nvidia.fake-powerd.service"]; | |
serviceConfig = { | |
Type = "dbus"; | |
BusName = busName; | |
ExecStart = "${pkgs.dbus}/bin/dbus-test-tool black-hole --system --name=${busName}"; | |
User = userName; | |
Group = userName; | |
LimitNPROC=2; | |
ProtectHome=true; | |
ProtectSystem="full"; | |
}; | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Ah I see - well I misunderstood the assignment haha.