nixcfg/homeManagerModules/services/pipewire-inhibit/default.nix
Aly Raffauf 6aafa8969a
Some checks are pending
git-mirror / gitlab-sync (push) Waiting to run
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
home/desktop: check if sway/hyprland are enabled before binding services
2024-08-12 10:17:21 -04:00

27 lines
813 B
Nix

{
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";
BindsTo = lib.optional (cfg.desktop.hyprland.enable) "hyprland-session.target" ++ lib.optional (cfg.desktop.sway.enable) "sway-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 = "no";
};
Install.WantedBy = lib.optional (cfg.desktop.hyprland.enable) "hyprland-session.target" ++ lib.optional (cfg.desktop.sway.enable) "sway-session.target";
};
};
}