fix(desktop: make sure tailscale works at hyprland launch
All checks were successful
Discord / discord commits (push) Has been skipped

This commit is contained in:
matt1432 2024-07-10 17:33:09 -04:00
parent 13abafb1b2
commit fdea25896e

View file

@ -6,17 +6,34 @@
self, self,
... ...
}: let }: let
inherit (lib) makeLibraryPath mkIf optionalString; inherit (lib) getExe makeLibraryPath mkIf optionals optionalString;
inherit (pkgs.writers) writeTOML; inherit (pkgs.writers) writeTOML;
flakeDir = config.environment.variables.FLAKE; flakeDir = config.environment.variables.FLAKE;
cfg = config.roles.desktop; cfg = config.roles.desktop;
nvidiaEnable = config.nvidia.enable; nvidiaEnable = config.nvidia.enable;
restartTailscale = pkgs.writeShellScriptBin "restartTailscale" ''
sudo ${pkgs.systemd}/bin/systemctl restart tailscaled.service
'';
in { in {
imports = [./dolphin.nix]; imports = [./dolphin.nix];
programs.kdeconnect.enable = true; programs.kdeconnect.enable = true;
security.sudo.extraRules = [
{
users = [cfg.user];
groups = [100];
commands = [
{
command = "${pkgs.systemd}/bin/systemctl restart tailscaled.service";
options = ["SETENV" "NOPASSWD"];
}
];
}
];
home-manager.users.${cfg.user} = { home-manager.users.${cfg.user} = {
imports = [ imports = [
./home/foot.nix ./home/foot.nix
@ -182,7 +199,8 @@ in {
wayland.windowManager.hyprland = { wayland.windowManager.hyprland = {
settings = { settings = {
exec-once = [ exec-once =
[
"${config.programs.kdeconnect.package}/libexec/kdeconnectd" "${config.programs.kdeconnect.package}/libexec/kdeconnectd"
"kdeconnect-indicator" "kdeconnect-indicator"
@ -192,6 +210,9 @@ in {
"[workspace special:protonmail silent] proton-mail" "[workspace special:protonmail silent] proton-mail"
"[workspace special:spot silent] spotify" "[workspace special:spot silent] spotify"
]
++ optionals config.services.tailscale.enable [
"sleep 3; ${getExe restartTailscale}"
]; ];
windowrule = [ windowrule = [