summaryrefslogtreecommitdiff
path: root/modules/apps/astal.nix
blob: e57263ecedcf9019cfdf65936a9571dc0383cbd2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
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"
        ];
      };
    };
  };
}