summaryrefslogtreecommitdiff
path: root/modules/apps/astal.nix
diff options
context:
space:
mode:
Diffstat (limited to 'modules/apps/astal.nix')
-rw-r--r--modules/apps/astal.nix47
1 files changed, 47 insertions, 0 deletions
diff --git a/modules/apps/astal.nix b/modules/apps/astal.nix
new file mode 100644
index 0000000..e57263e
--- /dev/null
+++ b/modules/apps/astal.nix
@@ -0,0 +1,47 @@
+{
+ lib,
+ config,
+ pkgs,
+ inputs,
+ system,
+ ...
+}: let
+ astal = inputs.self.packages.${system};
+ inherit (lib) mkIf;
+ cfg = config.apps;
+in {
+ config = mkIf cfg.astal {
+ default.appLauncher = lib.mkDefault "astal-launcher";
+
+ home-manager.users.${config.user} = {
+ home.packages = [
+ astal.astal.shell
+ astal.astal.launcher
+ ];
+
+ systemd.user.services.astal = {
+ Unit = {
+ Description = "Custom Gtk Lua Shell.";
+ PartOf = [
+ config.default.session
+ "tray.target"
+ ];
+ After = [config.default.session];
+ ConditionEnvironment = "WAYLAND_DISPLAY";
+ };
+
+ Service = {
+ ExecReload = "${pkgs.coreutils}/bin/kill -SIGUSR2 $MAINPID";
+ ExecStart = "${astal.astal.shell}/bin/astal-shell";
+ KillMode = "mixed";
+ Restart = "on-failure";
+ };
+
+ Install.WantedBy = [
+ config.default.session
+ "tray.target"
+ ];
+ };
+ };
+ };
+}