home: make wayland-ipewire-idle-inhibit a systemd service
Some checks are pending
nix-build / default-build (push) Waiting to run
nix-build / fallarbor-build (push) Waiting to run
nix-build / lavaridge-build (push) Waiting to run
nix-build / mauville-build (push) Waiting to run
nix-build / petalburg-build (push) Waiting to run
nix-build / rustboro-build (push) Waiting to run
nix-check / fmt-check (push) Waiting to run
nix-check / eval-check (push) Waiting to run

This commit is contained in:
Aly Raffauf 2024-08-02 17:00:43 -04:00
parent 3eff37c8aa
commit 8cb38f8a30
6 changed files with 29 additions and 2 deletions

View file

@ -127,7 +127,6 @@ in {
[
"${pkgs.mate.mate-polkit}/libexec/polkit-mate-authentication-agent-1"
(lib.getExe pkgs.waybar)
(lib.getExe pkgs.wayland-pipewire-idle-inhibit)
]
++ lib.lists.optional (cfg.desktop.randomWallpaper)
helpers.wallpaperD

View file

@ -159,7 +159,6 @@ in {
[
{command = "${pkgs.mate.mate-polkit}/libexec/polkit-mate-authentication-agent-1";}
{command = lib.getExe pkgs.autotiling;}
{command = lib.getExe pkgs.wayland-pipewire-idle-inhibit;}
]
++ lib.optional cfg.desktop.randomWallpaper {command = "${helpers.wallpaperD}";}
++ lib.optional (!cfg.desktop.randomWallpaper) {command = "${lib.getExe pkgs.swaybg} -i ${cfg.theme.wallpaper}";};

View file

@ -15,6 +15,7 @@
services = {
mako.enable = lib.mkDefault true;
pipewire-inhibit.enable = lib.mkDefault true;
swayidle.enable = lib.mkDefault true;
};
};

View file

@ -218,6 +218,7 @@ in {
};
};
pipewire-inhibit.enable = lib.mkEnableOption "Inhibit idle when audio is playing with Pipewire.";
swayidle.enable = lib.mkEnableOption "Swayidle idle daemon.";
};

View file

@ -4,6 +4,7 @@
./gammastep
./mako
./mpd
./pipewire-inhibit
./swayidle
];
}

View file

@ -0,0 +1,26 @@
{
config,
lib,
pkgs,
...
}: let
cfg = config.ar.home;
in {
config = lib.mkIf cfg.services.pipewire-inhibit.enable {
systemd.user.services.pipewire-inhibit-idle = {
Unit = {
After = "graphical-session.target";
Description = "inhibit idle when audio is playing with Pipewire.";
PartOf = "graphical-session.target";
};
Service = {
ExecStart = lib.getExe pkgs.wayland-pipewire-idle-inhibit;
Restart = "on-failure";
RestartSec = 5;
};
Install.WantedBy = ["hyprland-session.target" "sway-session.target"];
};
};
}