mirror of
https://github.com/aviallon/nixos-lib.git
synced 2026-04-06 01:38:06 +00:00
[Desktop] Refactor configuration
This commit is contained in:
parent
cff1f34d05
commit
b9dbcfd715
8 changed files with 277 additions and 247 deletions
|
|
@ -2,8 +2,12 @@
|
|||
with lib;
|
||||
let
|
||||
cfg = config.aviallon.desktop;
|
||||
generalCfg = config.aviallon.general;
|
||||
filterConfig = pkgs.callPackage ./pipewire-noise-filter.cfg.nix {
|
||||
noiseFilterStrength = cfg.audio.noise-filter.strength;
|
||||
};
|
||||
in {
|
||||
config = mkIf cfg.enable {
|
||||
config = mkIf (cfg.enable && !generalCfg.minimal) {
|
||||
environment.systemPackages = with pkgs; [
|
||||
ffmpeg-full
|
||||
krita
|
||||
|
|
@ -12,7 +16,62 @@ in {
|
|||
yt-dlp
|
||||
jellyfin-media-player
|
||||
|
||||
jamesdsp # Audio post-processing
|
||||
|
||||
nur.repos.wolfangaukang.vdhcoapp
|
||||
];
|
||||
|
||||
|
||||
# Enable sound.
|
||||
sound.enable = mkOverride 40 false;
|
||||
hardware.pulseaudio.enable = mkOverride 40 false;
|
||||
services.pipewire = {
|
||||
enable = true;
|
||||
pulse.enable = true;
|
||||
jack.enable = true;
|
||||
alsa.enable = true;
|
||||
alsa.support32Bit = mkDefault true;
|
||||
wireplumber.enable = true;
|
||||
config.pipewire-pulse = {
|
||||
"context.exec" = [
|
||||
{ path = "pactl"; args = ''load-module module-combine-sink sink_name="Sorties combinées"''; }
|
||||
];
|
||||
};
|
||||
};
|
||||
environment.etc = {
|
||||
"wireplumber/bluetooth.lua.d/51-bluez-config.lua".text = ''
|
||||
bluez_monitor.properties = {
|
||||
["bluez5.enable-sbc-xq"] = true,
|
||||
["bluez5.enable-msbc"] = true,
|
||||
["bluez5.enable-hw-volume"] = true,
|
||||
["bluez5.headset-roles"] = "[ hsp_hs hsp_ag hfp_hf hfp_ag ]"
|
||||
}
|
||||
'';
|
||||
};
|
||||
security.rtkit.enable = true; # Real-time support for pipewire
|
||||
|
||||
|
||||
# Hardware-agnostic audio denoising
|
||||
systemd.user.services.pipewire-noise-filter = mkIf cfg.audio.noise-filter.enable {
|
||||
unitConfig = {
|
||||
Slice = "session.slice";
|
||||
};
|
||||
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";
|
||||
};
|
||||
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue