grimm-nixos-laptop/common/tooling/lilypond.nix

54 lines
1.3 KiB
Nix
Raw Normal View History

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