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=~.
DNSOverTLS=yes
DNSSEC=false
MulticastDNS=no
'';
};
networking = import ./networking.nix;
@ -88,14 +87,14 @@ in {
path = [pkgs.bash];
description = "Power Off dedicated AMD Card to reduce power usage";
requires = ["sys-kernel-debug.mount"];
enable = false;
enable = true;
serviceConfig = {
Type = "oneshot";
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'";
};
wantedBy = ["graphical.target"];
wantedBy = ["multi-user.target"];
};
# Increase console font size for HiDPI display
@ -133,9 +132,12 @@ in {
${pkgs.systemd}/bin/systemctl stop amd-hybrid-graphics-power-save.service
''
);
resumeCommands = ''
resumeCommands =
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