fix(bbsteamie): restart NetworkManager on launch
All checks were successful
Discord / discord commits (push) Has been skipped

This commit is contained in:
matt1432 2025-02-16 12:21:47 -05:00
parent ad8b45a7c7
commit 381fa3d101

View file

@ -8,6 +8,12 @@ defaultSession: {
config = let config = let
inherit (lib) findFirst getExe mkForce; inherit (lib) findFirst getExe mkForce;
restartNetwork = getExe (pkgs.writeShellApplication {
name = "restart-network";
runtimeInputs = with pkgs; [systemd];
text = "systemctl restart NetworkManager";
});
switch-session = pkgs.writeShellApplication { switch-session = pkgs.writeShellApplication {
name = "switch-session"; name = "switch-session";
@ -63,16 +69,21 @@ defaultSession: {
''; '';
}; };
# Make it so we don't need root to switch to gaming mode
security.sudo.extraRules = [ security.sudo.extraRules = [
{ {
users = [mainUser]; users = [mainUser];
groups = [100]; groups = [100];
commands = [ commands = [
# Make it so we don't need root to switch to gaming mode
{ {
command = "${pkgs.systemd}/bin/systemctl start to-gaming-mode.service"; command = "${pkgs.systemd}/bin/systemctl start to-gaming-mode.service";
options = ["SETENV" "NOPASSWD"]; options = ["SETENV" "NOPASSWD"];
} }
# Make it so we don't need root to restart the network on launch
{
command = restartNetwork;
options = ["SETENV" "NOPASSWD"];
}
]; ];
} }
]; ];
@ -101,10 +112,11 @@ defaultSession: {
"autostart/${name}.desktop".text = "[Desktop Entry]\nType=Application\nExec=${name} ${flags}"; "autostart/${name}.desktop".text = "[Desktop Entry]\nType=Application\nExec=${name} ${flags}";
}; };
in ( in (
# Needs xdg-desktop-portal-kde patch provided by `self.overlays.xdg-desktop-portal-kde` (mkAutostart "sudo" restartNetwork)
{"plasmaremotedesktoprc".text = "[Sharing]\nUnattended=true";}
// (mkAutostart "krfb" "--nodialog %c")
// (mkAutostart "steam" "-silent %U") // (mkAutostart "steam" "-silent %U")
# Needs xdg-desktop-portal-kde patch provided by `self.overlays.xdg-desktop-portal-kde`
// {"plasmaremotedesktoprc".text = "[Sharing]\nUnattended=true";}
// (mkAutostart "krfb" "--nodialog %c")
); );
}; };
}; };