From c8bb94806ddf8a7d00f6bdd31b8d02eb3153317c Mon Sep 17 00:00:00 2001 From: leo Date: Tue, 13 Jun 2023 12:58:49 +0200 Subject: [PATCH] nix: manage waybar with home-manager --- .config/systemd/user/waybar.service | 17 ----------------- .../user/waybar.service.d/override.conf | 2 -- home-leo.nix | 19 +++++++++++++++++++ 3 files changed, 19 insertions(+), 19 deletions(-) delete mode 100644 .config/systemd/user/waybar.service delete mode 100644 .config/systemd/user/waybar.service.d/override.conf diff --git a/.config/systemd/user/waybar.service b/.config/systemd/user/waybar.service deleted file mode 100644 index f4b8986..0000000 --- a/.config/systemd/user/waybar.service +++ /dev/null @@ -1,17 +0,0 @@ -# ~/.config/systemd/user/waybar.service or /etc/systemd/user/waybar.service -[Unit] -Description=Highly customizable Wayland bar for Sway and Wlroots based compositors. -Documentation=https://github.com/Alexays/Waybar/wiki/ -#PartOf=graphical-session.target -PartOf=sway-session.target -After=sway-session.target - -[Service] -ExecStart=/usr/bin/waybar -# Upstreamed in https://github.com/Alexays/Waybar/pull/1036 -ExecReload=kill -SIGUSR2 $MAINPID -Restart=on-failure -RestartSec=5s - -[Install] -WantedBy=sway-session.target \ No newline at end of file diff --git a/.config/systemd/user/waybar.service.d/override.conf b/.config/systemd/user/waybar.service.d/override.conf deleted file mode 100644 index 3e9cc7d..0000000 --- a/.config/systemd/user/waybar.service.d/override.conf +++ /dev/null @@ -1,2 +0,0 @@ -[Service] -Environment=PATH=%h/bin:/usr/local/bin:/usr/bin \ No newline at end of file diff --git a/home-leo.nix b/home-leo.nix index 8b230f9..bb3c606 100644 --- a/home-leo.nix +++ b/home-leo.nix @@ -83,6 +83,7 @@ in { bemenu swayr kanshi + waybar ]; imports = [ @@ -117,6 +118,24 @@ in { Install = {WantedBy = [config.services.kanshi.systemdTarget];}; }; + waybar = { + Unit = { + Description = "Highly customizable Wayland bar for Sway and Wlroots based compositors."; + Documentation = "https://github.com/Alexays/Waybar/wiki/"; + PartOf = swayTgt; + After = swayTgt; + }; + + Service = { + ExecStart = "${pkgs.waybar}/bin/waybar"; + ExecReload = "kill -SIGUSR2 $MAINPID"; + Restart = "on-failure"; + RestartSec = "3s"; + }; + + Install = {WantedBy = [swayTgt];}; + }; + autotiling = { Unit = { Description = "Script for sway and i3 to automatically switch the horizontal / vertical window split orientation";