mirror of
https://github.com/aviallon/nixos-lib.git
synced 2026-04-05 17:27:50 +00:00
[Desktop/Multimedia] fix pipewire-noise-filter (and make it visible in outputs selection)
This commit is contained in:
parent
92b6e28cfe
commit
0524dde7e9
2 changed files with 27 additions and 19 deletions
|
|
@ -4,7 +4,7 @@ let
|
|||
cfg = config.aviallon.desktop;
|
||||
generalCfg = config.aviallon.general;
|
||||
|
||||
filterConfig = pkgs.callPackage ./pipewire-noise-filter.cfg.nix {
|
||||
filterConfig = pkgs.callPackage ./pipewire/pipewire-noise-filter.conf.nix {
|
||||
noiseFilterStrength = cfg.audio.noise-filter.strength;
|
||||
};
|
||||
|
||||
|
|
@ -84,25 +84,33 @@ in {
|
|||
|
||||
|
||||
# Hardware-agnostic audio denoising
|
||||
systemd.user.services.pipewire-noise-filter = mkIf cfg.audio.noise-filter.enable {
|
||||
unitConfig = {
|
||||
Slice = "session.slice";
|
||||
systemd.user.services = let
|
||||
mkPipewireModule = {conf, description}: {
|
||||
unitConfig = {
|
||||
Slice = "session.slice";
|
||||
};
|
||||
serviceConfig = {
|
||||
ExecStart = [
|
||||
"${pkgs.pipewire}/bin/pipewire -c ${conf}"
|
||||
];
|
||||
Type = "simple";
|
||||
Restart = "on-failure";
|
||||
};
|
||||
bindsTo = [ "pipewire.service" ];
|
||||
after = [ "pipewire.service" ];
|
||||
environment = {
|
||||
PIPEWIRE_DEBUG = "3";
|
||||
};
|
||||
wantedBy = [ "pipewire.service" ];
|
||||
inherit description;
|
||||
};
|
||||
serviceConfig = {
|
||||
ExecStart = [
|
||||
"${pkgs.pipewire}/bin/pipewire -c ${filterConfig}"
|
||||
];
|
||||
Type = "simple";
|
||||
Restart = "on-failure";
|
||||
};
|
||||
bindsTo = [ "pipewire.service" ];
|
||||
after = [ "pipewire.service" ];
|
||||
environment = {
|
||||
PIPEWIRE_DEBUG = "3";
|
||||
};
|
||||
enable = cfg.audio.noise-filter.strength > 0.0;
|
||||
wantedBy = [ "pipewire.service" ];
|
||||
description = "Pipewire Noise Filter";
|
||||
in {
|
||||
pipewire-noise-filter = mkIf cfg.audio.noise-filter.enable (
|
||||
(mkPipewireModule { conf = filterConfig; description = "Pipewire Noise Filter"; }) //
|
||||
{
|
||||
enable = cfg.audio.noise-filter.strength > 0.0;
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue