{ 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" ]; }; }; }; }