grimm-nixos-laptop/common/sound/midi.nix
2024-05-11 22:55:59 +02:00

28 lines
555 B
Nix

{
config,
lib,
pkgs,
...
}:
let
sound_font = pkgs.soundfont-fluid;
inherit (config.grimmShared) enable sound;
in
{
config = lib.mkIf (enable && sound.midi) {
environment.systemPackages =
(with pkgs; [
mpv
timidity
ffmpeg-full
])
++ [ sound_font ];
environment.pathsToLink = [ "/share/soundfonts" ];
environment.etc."timidity/timidity.cfg".text = "soundfont ${sound_font}/share/soundfonts/FluidR3_GM2-2.sf2";
};
options.grimmShared.sound.midi = lib.mkEnableOption "enable midi";
}