nixos/parts/modules/desktop/astal/default.nix

75 lines
1.7 KiB
Nix
Raw Normal View History

2025-01-31 15:13:22 +01:00
{
inputs,
pkgs,
2025-02-18 20:17:57 +01:00
lib,
config,
2025-01-31 15:13:22 +01:00
...
}: let
2025-02-18 20:17:57 +01:00
packageName = "fireproof-shell";
cfg = config.modules.astral;
2025-01-31 15:13:22 +01:00
package = inputs.ags.lib.bundle {
inherit pkgs;
2025-02-18 20:17:57 +01:00
src = ./.;
2025-01-31 15:13:22 +01:00
name = packageName;
gtk4 = true;
entry = "app.ts";
extraPackages = with inputs.ags.packages.${pkgs.system}; [
battery
bluetooth
hyprland
network
tray
notifd
mpris
wireplumber
];
};
in {
2025-02-18 20:17:57 +01:00
options = {
modules.astral.primaryMonitor = lib.mkOption {
type = lib.types.string;
default = "";
example = "M27Q";
};
modules.astral.notificationIgnores = lib.mkOption {
type = lib.types.listOf lib.types.str;
default = ["/^Spotify/"];
example = ["/^Spotify/"];
};
modules.astral.trayIgnore = lib.mkOption {
type = lib.types.listOf lib.types.str;
default = ["/spotify/"];
example = ["/spotify/"];
};
};
config = {
environment.systemPackages = [package inputs.ags.packages.${pkgs.system}.agsFull];
fireproof.home-manager = {
2025-01-31 15:13:22 +01:00
systemd.user.services.astal = {
Unit = {
Description = "Astal";
Documentation = "https://github.com/Aylur/astal";
After = ["graphical-session.target"];
};
Service = {
ExecStart = "${package}/bin/${packageName}";
Restart = "on-failure";
KillMode = "mixed";
Slice = "app-graphical.slice";
2025-02-18 20:17:57 +01:00
DefaultEnvironment = ''
ASTRAL_PRIMARY_MONITOR=${cfg.primaryMonitor}
ASTRAL_NOTIFICATION_IGNORE=${lib.concatStringsSep "," cfg.notificationIgnores}
ASTRAL_TRAY_IGNORE=${lib.concatStringsSep "," cfg.trayIgnore}
'';
2025-01-31 15:13:22 +01:00
};
Install = {
WantedBy = ["graphical-session.target"];
};
};
};
2025-02-18 20:17:57 +01:00
};
}