grimm-nixos-laptop/common/sound/midi.nix
2024-05-07 23:31:41 +02:00

29 lines
551 B
Nix

{
config,
lib,
pkgs,
...
}:
let
cfg = config.grimmShared;
sound_font = pkgs.soundfont-fluid;
in
{
config =
with cfg;
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";
}