mirror of
https://github.com/nix-community/home-manager
synced 2024-12-04 17:09:47 +01:00
72394f6d6b
Fluidsynth's systemd unit currently has a hard dependency on the pulseaudio systemd service. Since fluidsynth can use other sound services (e.g., pipewire-pulse), this should be configurable. This commit adds the relevant option. PR #2238
31 lines
887 B
Nix
31 lines
887 B
Nix
{ config, pkgs, ... }: {
|
|
config = {
|
|
services.fluidsynth.enable = true;
|
|
services.fluidsynth.soundService = "pipewire-pulse";
|
|
services.fluidsynth.soundFont = "/path/to/soundFont";
|
|
services.fluidsynth.extraOptions = [ "--sample-rate 96000" ];
|
|
|
|
nixpkgs.overlays = [
|
|
(self: super: {
|
|
fluidsynth = pkgs.writeScriptBin "dummy-fluidsynth" "" // {
|
|
outPath = "@fluidsynth@";
|
|
};
|
|
})
|
|
];
|
|
|
|
nmt.script = ''
|
|
serviceFile=home-files/.config/systemd/user/fluidsynth.service
|
|
|
|
assertFileExists $serviceFile
|
|
|
|
assertFileContains $serviceFile \
|
|
'ExecStart=@fluidsynth@/bin/fluidsynth -a pulseaudio -si --sample-rate 96000 /path/to/soundFont'
|
|
|
|
assertFileContains $serviceFile \
|
|
'After=pipewire-pulse.service'
|
|
|
|
assertFileContains $serviceFile \
|
|
'BindsTo=pipewire-pulse.service'
|
|
'';
|
|
};
|
|
}
|