|
26 | 26 | # TODO: Switch back to `tidalcycles` repo once Vim8 terminal support lands. |
27 | 27 | # See this PR: https://github.com/tidalcycles/vim-tidal/pull/74 |
28 | 28 | # url = "github:tidalcycles/vim-tidal/master"; |
29 | | - url = "github:mitchmindtree/vim-tidal/flupe-vim8-terminal-rebased"; |
| 29 | + url = "github:mitchmindtree/vim-tidal/superdirt-term"; |
30 | 30 | flake = false; |
31 | 31 | }; |
32 | 32 | vowel-src = { |
|
73 | 73 | }; |
74 | 74 |
|
75 | 75 | # Run `SuperDirt.start` in supercollider, ready for tidal. |
76 | | - superdirt-start = pkgs.writeShellScriptBin "superdirt-start" '' |
77 | | - ${supercollider}/bin/sclang \ |
78 | | - -l "${superdirt}/sclang_conf.yaml" \ |
79 | | - ${pkgs.writeText "superdirt-start.sc" "SuperDirt.start;"} |
80 | | - ''; |
| 76 | + superdirt-start = pkgs.writeShellApplication { |
| 77 | + name = "superdirt-start"; |
| 78 | + runtimeInputs = [supercollider]; |
| 79 | + text = '' |
| 80 | + ${supercollider}/bin/sclang \ |
| 81 | + -l "${superdirt}/sclang_conf.yaml" \ |
| 82 | + ${pkgs.writeText "superdirt-start.sc" "SuperDirt.start;"} |
| 83 | + ''; |
| 84 | + }; |
81 | 85 |
|
82 | 86 | # Installs SuperDirt under your user's supercollider quarks. |
83 | 87 | superdirt-install = pkgs.writeShellScriptBin "superdirt-start" '' |
|
94 | 98 | pname = "vim-tidal"; |
95 | 99 | version = "master"; |
96 | 100 | src = inputs.vim-tidal-src; |
97 | | - # Patch the default GHCI with our `tidal` instance. |
98 | | - # TODO: Update `vim-tidal` to use an env var by default or something instead. |
99 | | - # Would be much cleaner than a patch with might conflict with future commits. |
100 | | - patches = [./patch/vim-tidal-ghci.patch]; |
| 101 | + postInstall = let |
| 102 | + # A vimscript file to set Nix defaults for ghci and `BootTidal.hs`. |
| 103 | + defaults-file = pkgs.writeText "vim-tidal-defaults.vim" '' |
| 104 | + " Prepend defaults provided by Nix packages. |
| 105 | + if !exists("g:tidal_ghci") |
| 106 | + let g:tidal_ghci = "${ghcWithTidal}/bin/ghci" |
| 107 | + endif |
| 108 | + if !exists("g:tidal_boot") |
| 109 | + let g:tidal_boot = "${inputs.tidal-src}/BootTidal.hs" |
| 110 | + endif |
| 111 | + if !exists("g:tidal_superdirt_start") |
| 112 | + let g:tidal_superdirt_start = "${superdirt-start}/bin/superdirt-start" |
| 113 | + endif |
| 114 | + ''; |
| 115 | + in '' |
| 116 | + # Prepend a line to `plugin/tidal.vim` to source the defaults. |
| 117 | + mv $out/plugin/tidal.vim $out/plugin/tidal.vim.old |
| 118 | + cat ${defaults-file} $out/plugin/tidal.vim.old > $out/plugin/tidal.vim |
| 119 | + rm $out/plugin/tidal.vim.old |
| 120 | +
|
| 121 | + # Remove unnecessary files. |
| 122 | + rm -r $out/bin |
| 123 | + rm $out/Makefile |
| 124 | + rm $out/Tidal.ghci |
| 125 | + ''; |
101 | 126 | meta = { |
102 | 127 | homepage = "https://github.com/tidalcycles/vim-tidal.vim"; |
103 | 128 | license = pkgs.lib.licenses.mit; |
|
0 commit comments