From 8ac235cb8cac6c775485a4357c08ae7d53f799fb Mon Sep 17 00:00:00 2001 From: Tom Alexander Date: Sat, 18 Jan 2025 11:48:53 -0500 Subject: [PATCH] Move disabling wifi power saving to a host-specific file. --- nix/configuration/hosts/odo/default.nix | 1 + nix/configuration/hosts/odo/wifi.nix | 16 ++++++++++++++++ .../roles/launch_keyboard/default.nix | 1 - nix/configuration/roles/sway/default.nix | 5 ++--- 4 files changed, 19 insertions(+), 4 deletions(-) create mode 100644 nix/configuration/hosts/odo/wifi.nix diff --git a/nix/configuration/hosts/odo/default.nix b/nix/configuration/hosts/odo/default.nix index 2519e96..52c4081 100644 --- a/nix/configuration/hosts/odo/default.nix +++ b/nix/configuration/hosts/odo/default.nix @@ -6,6 +6,7 @@ ./optimized_build.nix ./power_management.nix ./screen_brightness.nix + ./wifi.nix ]; # Generate with `head -c4 /dev/urandom | od -A none -t x4` diff --git a/nix/configuration/hosts/odo/wifi.nix b/nix/configuration/hosts/odo/wifi.nix new file mode 100644 index 0000000..64d4247 --- /dev/null +++ b/nix/configuration/hosts/odo/wifi.nix @@ -0,0 +1,16 @@ +{ + config, + lib, + pkgs, + ... +}: + +{ + imports = [ ]; + + config = { + environment.loginShellInit = lib.mkIf (!config.me.buildingIso) '' + doas iw dev wlan0 set power_save off + ''; + }; +} diff --git a/nix/configuration/roles/launch_keyboard/default.nix b/nix/configuration/roles/launch_keyboard/default.nix index ba51cb4..650853a 100644 --- a/nix/configuration/roles/launch_keyboard/default.nix +++ b/nix/configuration/roles/launch_keyboard/default.nix @@ -16,7 +16,6 @@ lxqt.lxqt-policykit # Need a polkit agent to launch the keyboard configurator ]; - # TODO: Switch sway to using seatd instead of polkit systemd = { user.services.lxqt-policykit-agent = { description = "lxqt-policykit-agent"; diff --git a/nix/configuration/roles/sway/default.nix b/nix/configuration/roles/sway/default.nix index 7cca2de..cd55c21 100644 --- a/nix/configuration/roles/sway/default.nix +++ b/nix/configuration/roles/sway/default.nix @@ -383,9 +383,8 @@ in services.gvfs.enable = true; # Auto-launch sway - environment.loginShellInit = '' - # TODO: This shouldn't be shoe-horned into the sway config - doas iw dev wlan0 set power_save off + # Run sway as the absolute last command in the login shell init. mkBefore = 500, plain = 1000, mkAfter = 1500 + environment.loginShellInit = lib.mkOrder 2000 '' [ -z "$WAYLAND_DISPLAY" ] && [ -n "$XDG_VTNR" ] && [ "$XDG_VTNR" -eq 1 ] && [ "$(tty)" = "/dev/tty1" ] && exec ${pkgs.systemd}/bin/systemd-cat --identifier=sway sway ''; };