System Gen77 @ 2025-06-25-01:20:16 by jonas@monolith
This commit is contained in:
parent
1a4c3ff397
commit
952839b93f
@ -1,6 +1,7 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
cfg = config.hive.sound;
|
||||
@ -17,6 +18,11 @@ in {
|
||||
default = false;
|
||||
description = "Enable Noisetorch for noise cancellation.";
|
||||
};
|
||||
noisetorch-threshold = lib.mkOption {
|
||||
type = lib.types.int;
|
||||
default = -1;
|
||||
description = "Set the noise cancellation threshold for Noisetorch.";
|
||||
};
|
||||
};
|
||||
};
|
||||
config = lib.mkIf cfg.enable {
|
||||
@ -36,5 +42,17 @@ in {
|
||||
#media-session.enable = true;
|
||||
};
|
||||
programs.noisetorch.enable = cfg.noisetorch;
|
||||
systemd.user.services.noisetorch-autoload = lib.mkIf cfg.noisetorch {
|
||||
description = "Automatically load Noisetorch on user login";
|
||||
after = ["pipewire.service"];
|
||||
requires = ["pipewire.service"];
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
ExecStart = "${pkgs.noisetorch}/bin/noisetorch -l -t ${toString cfg.noisetorch-threshold}";
|
||||
ExecStop = "${pkgs.noisetorch}/bin/noisetorch -u";
|
||||
RemainAfterExit = true;
|
||||
};
|
||||
wantedBy = ["default.target"];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user