dumpyourvms: fixes for amd power save and resume

and cups mDNS with systemd-resolved
This commit is contained in:
teutat3s 2023-05-31 21:00:13 +02:00
parent d21c7631ab
commit cbe1deee5b
Signed by: teutat3s
GPG key ID: 4FA1D3FA524F22C1

View file

@ -73,7 +73,6 @@ in {
Domains=~. Domains=~.
DNSOverTLS=yes DNSOverTLS=yes
DNSSEC=false DNSSEC=false
MulticastDNS=no
''; '';
}; };
networking = import ./networking.nix; networking = import ./networking.nix;
@ -88,14 +87,14 @@ in {
path = [pkgs.bash]; path = [pkgs.bash];
description = "Power Off dedicated AMD Card to reduce power usage"; description = "Power Off dedicated AMD Card to reduce power usage";
requires = ["sys-kernel-debug.mount"]; requires = ["sys-kernel-debug.mount"];
enable = false; enable = true;
serviceConfig = { serviceConfig = {
Type = "oneshot"; Type = "oneshot";
RemainAfterExit = true; RemainAfterExit = true;
ExecStart = "${pkgs.bash}/bin/sh -c 'echo -e \"IGD\\nOFF\" > /sys/kernel/debug/vgaswitcheroo/switch'"; ExecStart = "${pkgs.bash}/bin/sh -c 'sleep 7 && echo -e \"IGD\\nOFF\" > /sys/kernel/debug/vgaswitcheroo/switch'";
ExecStop = "${pkgs.bash}/bin/sh -c 'echo ON >/sys/kernel/debug/vgaswitcheroo/switch'"; ExecStop = "${pkgs.bash}/bin/sh -c 'echo ON >/sys/kernel/debug/vgaswitcheroo/switch'";
}; };
wantedBy = ["graphical.target"]; wantedBy = ["multi-user.target"];
}; };
# Increase console font size for HiDPI display # Increase console font size for HiDPI display
@ -133,9 +132,12 @@ in {
${pkgs.systemd}/bin/systemctl stop amd-hybrid-graphics-power-save.service ${pkgs.systemd}/bin/systemctl stop amd-hybrid-graphics-power-save.service
'' ''
); );
resumeCommands = '' resumeCommands =
${pkgs.systemd}/bin/systemctl start amd-hybrid-graphics-power-save.service if config.systemd.services."amd-hybrid-graphics-power-save".enable == true
''; then ''
${pkgs.systemd}/bin/systemctl start amd-hybrid-graphics-power-save.service
''
else "";
}; };
# Change lid switch behaviour # Change lid switch behaviour