ctucx.git: nixfiles

ctucx' nixfiles

commit 27609b4e1e5ef325e39266ac2b400d5f7c271bed
parent d56979f98426e7bd3ddd0810fe1c2e7e3e18ffbe
Author: Leah (ctucx) <leah@ctu.cx>
Date: Sun, 10 Oct 2021 15:45:53 +0200

programs/thunderbird: start as systemd-service
2 files changed, 22 insertions(+), 1 deletion(-)
diff --git a/configurations/programs/sway.nix b/configurations/programs/sway.nix
@@ -47,7 +47,6 @@
         exec dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP
 
         exec firefox
-        exec thunderbrid
 
         exec swaymsg 'workspace 3: Term; exec ${terminal}; exec ${terminal};'
         exec swaymsg 'workspace 6: Files; exec thunar;'
diff --git a/configurations/programs/thunderbird.nix b/configurations/programs/thunderbird.nix
@@ -5,5 +5,27 @@
     home.packages = with pkgs; [
       thunderbird
     ];
+
+    systemd.user.services.thunderbird = {
+      Unit = {
+        After  = [ "graphical-session-pre.target" ];
+        PartOf = [ "graphical-session.target" ];
+      };
+
+      Service = {
+        Environment = "PATH=/run/wrappers/bin:/home/leah/.nix-profile/bin:/etc/profiles/per-user/leah/bin:/nix/var/nix/profiles/default/bin:/run/current-system/sw/bin";
+        ExecStart = "${pkgs.thunderbird}/bin/thunderbird";
+        Restart = "always";
+        RestartSec = 5;
+      };
+
+      Install = {
+        WantedBy = [ "graphical-session.target" ];
+      };
+    };
+
+    wayland.windowManager.sway.extraConfig = ''
+      exec_always 'systemctl --user restart thunderbird'
+    '';
   };
 }