58 lines
1.3 KiB
Nix
58 lines
1.3 KiB
Nix
{
|
|
lib,
|
|
pkgs,
|
|
config,
|
|
...
|
|
}:
|
|
let
|
|
inherit (config.grimmShared) enable tooling graphical;
|
|
inherit (lib)
|
|
getExe
|
|
optional
|
|
mkIf
|
|
optionalString
|
|
mkEnableOption
|
|
;
|
|
|
|
viewer_pkg = pkgs.zathura;
|
|
viewer_def = optionalString graphical ''pdf_viewer = "${lib.getExe pkgs.zathura}",'';
|
|
in
|
|
{
|
|
config = mkIf (enable && tooling.enable && tooling.lilypond) {
|
|
environment.systemPackages = [ pkgs.lilypond-with-fonts ] ++ optional graphical viewer_pkg;
|
|
environment.sessionVariables = {
|
|
LYEDITOR = "${getExe pkgs.neovim-remote} -s +:'dr %(file)s | call cursor(%(line)s,%(char)s+1)'";
|
|
};
|
|
|
|
grimmShared.sound.midi = true;
|
|
|
|
grimmShared.tooling.nvim = {
|
|
extraLuaRC = lib.singleton ''
|
|
require('nvls').setup({
|
|
lilypond = {
|
|
options = {
|
|
${viewer_def}
|
|
},
|
|
},
|
|
latex = {
|
|
options = {
|
|
${viewer_def}
|
|
},
|
|
},
|
|
player = {
|
|
options = {
|
|
fluidsynth_flags = {
|
|
"/run/current-system/sw/share/soundfonts/FluidR3_GM2-2.sf2"
|
|
}
|
|
}
|
|
}
|
|
})
|
|
'';
|
|
};
|
|
|
|
grimmShared.tooling.nvim.plugins = with pkgs.vimPlugins; [ nvim-lilypond-suite ];
|
|
};
|
|
|
|
options.grimmShared.tooling.lilypond = mkEnableOption "enable lilypond tooling";
|
|
}
|