Move PreSonus Studio patch to module
This commit is contained in:
parent
a091fb2a69
commit
71d953d253
@ -1,47 +0,0 @@
|
|||||||
{ config, lib, pkgs, ... }:
|
|
||||||
let
|
|
||||||
snd-usb-audio-module = pkgs.callPackage ./snd-usb-audio.nix {
|
|
||||||
kernel = config.boot.kernelPackages.kernel;
|
|
||||||
};
|
|
||||||
patched = snd-usb-audio-module.overrideAttrs (prev: {
|
|
||||||
patches = [ ./0001-Update-device-ID-for-PreSonus-1824c.patch ];
|
|
||||||
});
|
|
||||||
upmixConfig = ''
|
|
||||||
stream.properties = {
|
|
||||||
channelmix.upmix = true
|
|
||||||
channelmix.upmix-method = psd
|
|
||||||
}
|
|
||||||
'';
|
|
||||||
in {
|
|
||||||
boot.kernelModules = [ "snd-usb-audio" ];
|
|
||||||
boot.extraModulePackages = [
|
|
||||||
(patched)
|
|
||||||
];
|
|
||||||
|
|
||||||
environment.etc = {
|
|
||||||
"pipewire/pipewire.conf.d/surround.conf".text = ''
|
|
||||||
context.modules = [
|
|
||||||
{
|
|
||||||
name = libpipewire-module-loopback
|
|
||||||
args = {
|
|
||||||
node.description = "Genelec 4.1 Surround"
|
|
||||||
capture.props = {
|
|
||||||
node.name = "Genelec_Speakers"
|
|
||||||
media.class = "Audio/Sink"
|
|
||||||
audio.position = [ FL FR SL SR LFE ]
|
|
||||||
}
|
|
||||||
playback.props = {
|
|
||||||
node.name = "playback.Genelec_Speakers"
|
|
||||||
audio.position = [ AUX0 AUX1 AUX3 AUX4 AUX5 ]
|
|
||||||
target.object = "alsa_output.usb-PreSonus_Studio_1824c_SC4E21110775-00.multichannel-output"
|
|
||||||
stream.dont-remix = true
|
|
||||||
node.passive = true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
'';
|
|
||||||
"pipewire/pipewire-pulse.conf.d/40-upmix.conf".text = upmixConfig;
|
|
||||||
"pipewire/client-rt.conf.d/40-upmix.conf".text = upmixConfig;
|
|
||||||
};
|
|
||||||
}
|
|
@ -3,7 +3,6 @@
|
|||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
./audio.nix
|
|
||||||
../desktop.nix
|
../desktop.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
@ -73,6 +72,7 @@
|
|||||||
neovim.enable = true;
|
neovim.enable = true;
|
||||||
vscode.enable = true;
|
vscode.enable = true;
|
||||||
};
|
};
|
||||||
|
hardware.presonus-studio.enable = true;
|
||||||
security = {
|
security = {
|
||||||
gpg.enable = true;
|
gpg.enable = true;
|
||||||
pass.enable = true;
|
pass.enable = true;
|
||||||
|
@ -25,6 +25,7 @@
|
|||||||
./dev/zig.nix
|
./dev/zig.nix
|
||||||
./editors/neovim
|
./editors/neovim
|
||||||
./editors/vscode.nix
|
./editors/vscode.nix
|
||||||
|
./hardware/presonus-studio.nix
|
||||||
./networking/tailscale.nix
|
./networking/tailscale.nix
|
||||||
./networking/wireless.nix
|
./networking/wireless.nix
|
||||||
./security/gpg.nix
|
./security/gpg.nix
|
||||||
|
69
modules/hardware/presonus-studio.nix
Normal file
69
modules/hardware/presonus-studio.nix
Normal file
@ -0,0 +1,69 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
let
|
||||||
|
cfg = config.modules.hardware.presonus-studio;
|
||||||
|
snd-usb-audio-module = pkgs.callPackage ./snd-usb-audio.nix {
|
||||||
|
kernel = config.boot.kernelPackages.kernel;
|
||||||
|
};
|
||||||
|
patched = snd-usb-audio-module.overrideAttrs (prev: {
|
||||||
|
patches = [ ./0001-Update-device-ID-for-PreSonus-1824c.patch ];
|
||||||
|
});
|
||||||
|
upmixConfig = ''
|
||||||
|
stream.properties = {
|
||||||
|
channelmix.upmix = true
|
||||||
|
channelmix.upmix-method = psd
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
in {
|
||||||
|
options.modules.hardware.presonus-studio = {
|
||||||
|
enable = lib.mkOption {
|
||||||
|
default = false;
|
||||||
|
example = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
boot.kernelModules = [ "snd-usb-audio" ];
|
||||||
|
boot.extraModulePackages = [
|
||||||
|
(patched)
|
||||||
|
];
|
||||||
|
|
||||||
|
environment.etc = {
|
||||||
|
"pipewire/pipewire.conf.d/10-network.conf".text = ''
|
||||||
|
context.modules = [
|
||||||
|
{
|
||||||
|
name = libpipewire-module-rtp-session
|
||||||
|
args = {
|
||||||
|
stream.props = {
|
||||||
|
node.name = "rtp-source"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
'';
|
||||||
|
"pipewire/pipewire.conf.d/surround.conf".text = ''
|
||||||
|
context.modules = [
|
||||||
|
{
|
||||||
|
name = libpipewire-module-loopback
|
||||||
|
args = {
|
||||||
|
node.description = "Genelec 4.1 Surround"
|
||||||
|
capture.props = {
|
||||||
|
node.name = "Genelec_Speakers"
|
||||||
|
media.class = "Audio/Sink"
|
||||||
|
audio.position = [ FL FR SL SR LFE ]
|
||||||
|
}
|
||||||
|
playback.props = {
|
||||||
|
node.name = "playback.Genelec_Speakers"
|
||||||
|
audio.position = [ AUX0 AUX1 AUX3 AUX4 AUX5 ]
|
||||||
|
target.object = "alsa_output.usb-PreSonus_Studio_1824c_SC4E21110775-00.multichannel-output"
|
||||||
|
stream.dont-remix = true
|
||||||
|
node.passive = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
'';
|
||||||
|
"pipewire/pipewire-pulse.conf.d/40-upmix.conf".text = upmixConfig;
|
||||||
|
"pipewire/client-rt.conf.d/40-upmix.conf".text = upmixConfig;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user