···129129### Packaging a library on luarocks {#packaging-a-library-on-luarocks}
130130131131[Luarocks.org](https://luarocks.org/) is the main repository of lua packages.
132132-The site proposes two types of packages, the rockspec and the src.rock
132132+The site proposes two types of packages, the `rockspec` and the `src.rock`
133133(equivalent of a [rockspec](https://github.com/luarocks/luarocks/wiki/Rockspec-format) but with the source).
134134-These packages can have different build types such as `cmake`, `builtin` etc .
134134+135135+Luarocks-based packages are generated in [pkgs/development/lua-modules/generated-packages.nix](https://github.com/NixOS/nixpkgs/tree/master/pkgs/development/lua-modules/generated-packages.nix) from
136136+the whitelist maintainers/scripts/luarocks-packages.csv and updated by running
137137+the script
138138+[maintainers/scripts/update-luarocks-packages](https://github.com/NixOS/nixpkgs/tree/master/maintainers/scripts/update-luarocks-packages):
135139136136-Luarocks-based packages are generated in pkgs/development/lua-modules/generated-packages.nix from
137137-the whitelist maintainers/scripts/luarocks-packages.csv and updated by running maintainers/scripts/update-luarocks-packages.
140140+```sh
141141+./maintainers/scripts/update-luarocks-packages update
142142+```
138143139144[luarocks2nix](https://github.com/nix-community/luarocks) is a tool capable of generating nix derivations from both rockspec and src.rock (and favors the src.rock).
140145The automation only goes so far though and some packages need to be customized.
141141-These customizations go in `pkgs/development/lua-modules/overrides.nix`.
146146+These customizations go in [pkgs/development/lua-modules/overrides.nix](https://github.com/NixOS/nixpkgs/tree/master/pkgs/development/lua-modules/overrides.nix).
142147For instance if the rockspec defines `external_dependencies`, these need to be manually added to the overrides.nix.
143148144149You can try converting luarocks packages to nix packages with the command `nix-shell -p luarocks-nix` and then `luarocks nix PKG_NAME`.
+2-2
doc/languages-frameworks/vim.section.md
···212212213213## Adding new plugins to nixpkgs {#adding-new-plugins-to-nixpkgs}
214214215215-Nix expressions for Vim plugins are stored in [pkgs/applications/editors/vim/plugins](https://github.com/NixOS/nixpkgs/tree/master/pkgs/applications/editors/vim/plugins). For the vast majority of plugins, Nix expressions are automatically generated by running [`./update.py`](https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/editors/vim/plugins/update.py). This creates a [generated.nix](https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/editors/vim/plugins/generated.nix) file based on the plugins listed in [vim-plugin-names](https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/editors/vim/plugins/vim-plugin-names). Plugins are listed in alphabetical order in `vim-plugin-names` using the format `[github username]/[repository]@[gitref]`. For example https://github.com/scrooloose/nerdtree becomes `scrooloose/nerdtree`.
215215+Nix expressions for Vim plugins are stored in [pkgs/applications/editors/vim/plugins](https://github.com/NixOS/nixpkgs/tree/master/pkgs/applications/editors/vim/plugins). For the vast majority of plugins, Nix expressions are automatically generated by running [`./update.py`](https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/editors/vim/plugins/update.py). This creates a [generated.nix](https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/editors/vim/plugins/generated.nix) file based on the plugins listed in [vim-plugin-names](https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/editors/vim/plugins/vim-plugin-names).
216216217217After running `./update.py`, if nvim-treesitter received an update, also run [`nvim-treesitter/update.py`](https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/editors/vim/plugins/update.py) to update the tree sitter grammars for `nvim-treesitter`.
218218···226226227227Sometimes plugins require an override that must be changed when the plugin is updated. This can cause issues when Vim plugins are auto-updated but the associated override isn't updated. For these plugins, the override should be written so that it specifies all information required to install the plugin, and running `./update.py` doesn't change the derivation for the plugin. Manually updating the override is required to update these types of plugins. An example of such a plugin is `LanguageClient-neovim`.
228228229229-To add a new plugin, run `./update.py --add "[owner]/[name]"`. **NOTE**: This script automatically commits to your git repository. Be sure to check out a fresh branch before running.
229229+To add a new plugin, run `./update.py add "[owner]/[name]"`. **NOTE**: This script automatically commits to your git repository. Be sure to check out a fresh branch before running.
230230231231Finally, there are some plugins that are also packaged in nodePackages because they have Javascript-related build steps, such as running webpack. Those plugins are not listed in `vim-plugin-names` or managed by `update.py` at all, and are included separately in `overrides.nix`. Currently, all these plugins are related to the `coc.nvim` ecosystem of the Language Server Protocol integration with Vim/Neovim.
232232
···10101111 {
1212 imports = [ ./common/user-account.nix ];
1313+1414+ fonts.fonts = with pkgs; [ dejavu_fonts ];
1515+1316 services.cage = {
1417 enable = true;
1518 user = "alice";
1616- # Disable color and bold and use a larger font to make OCR easier:
1717- program = "${pkgs.xterm}/bin/xterm -cm -pc -fa Monospace -fs 24";
1919+ program = "${pkgs.xterm}/bin/xterm";
1820 };
19212022 # Need to switch to a different GPU driver than the default one (-vga std) so that Cage can launch:
···11-updateToolPath() {
22- local tool="$1"
33- local target="$2"
44- local original="${!outputBin}/$tool"
55- local actual="${!outputDev}/$tool"
66- if grep -q "$original" "$target"; then
77- echo "updateToolPath: Updating \`$original' in \`$target\'..."
88- sed -i "$target" -e "s|$original|$actual|"
99- fi
1010-}
1111-1212-moveQtDevTools() {
1313- if [ -n "$devTools" ]; then
1414- for tool in $devTools; do
1515- moveToOutput "$tool" "${!outputDev}"
1616- done
1717-1818- if [ -d "${!outputDev}/mkspecs" ]; then
1919- find "${!outputDev}/mkspecs" -name '*.pr?' | while read pr_; do
2020- for tool in $devTools; do
2121- updateToolPath "$tool" "$pr_"
2222- done
2323- done
2424- fi
2525-2626- if [ -d "${!outputDev}/lib/cmake" ]; then
2727- find "${!outputDev}/lib/cmake" -name '*.cmake' | while read cmake; do
2828- for tool in $devTools; do
2929- updateToolPath "$tool" "$cmake"
3030- done
3131- done
3232- fi
3333- fi
3434-}
···11if [[ -n "${__nix_qtbase-}" ]]; then
22 # Throw an error if a different version of Qt was already set up.
33- if [[ "$__nix_qtbase" != "@dev@" ]]; then
33+ if [[ "$__nix_qtbase" != "@out@" ]]; then
44 echo >&2 "Error: detected mismatched Qt dependencies:"
55- echo >&2 " @dev@"
55+ echo >&2 " @out@"
66 echo >&2 " $__nix_qtbase"
77 exit 1
88 fi
99else # Only set up Qt once.
1010- __nix_qtbase="@dev@"
1010+ __nix_qtbase="@out@"
11111212 qtPluginPrefix=@qtPluginPrefix@
1313 qtQmlPrefix=@qtQmlPrefix@
···3030 fi
31313232 # Build tools are often confused if QMAKE is unset.
3333- export QMAKE=@dev@/bin/qmake
3333+ export QMAKE=@out@/bin/qmake
34343535 export QMAKEPATH=
3636···5353 # Prevent this hook from running multiple times
5454 dontPatchMkspecs=1
55555656- local bin="${!outputBin}"
5757- local dev="${!outputDev}"
5858- local doc="${!outputDoc}"
5956 local lib="${!outputLib}"
60576161- moveToOutput "mkspecs" "$dev"
6262- moveToOutput "modules" "$dev"
6363- moveToOutput "lib/*.prl" "$dev"
6464-6565- if [ -d "$dev/mkspecs/modules" ]; then
6666- fixQtModulePaths "$dev/mkspecs/modules"
5858+ if [ -d "$lib/mkspecs/modules" ]; then
5959+ fixQtModulePaths "$lib/mkspecs/modules"
6760 fi
68616969- if [ -d "$dev/mkspecs" ]; then
7070- fixQtBuiltinPaths "$dev/mkspecs" '*.pr?'
6262+ if [ -d "$lib/mkspecs" ]; then
6363+ fixQtBuiltinPaths "$lib/mkspecs" '*.pr?'
7164 fi
72657373- if [ -d "$dev/lib" ]; then
7474- fixQtBuiltinPaths "$dev/lib" '*.pr?'
6666+ if [ -d "$lib/lib" ]; then
6767+ fixQtBuiltinPaths "$lib/lib" '*.pr?'
7568 fi
7669 }
7770 if [ -z "${dontPatchMkspecs-}" ]; then
···11-From 9ba9c690fb16188ff524b53def104e68e45cf5c3 Mon Sep 17 00:00:00 2001
11+From 5bd3672c7870b2e46e2a734dc9a9cb1837375a1c Mon Sep 17 00:00:00 2001
22From: Nick Cao <nickcao@nichi.co>
33Date: Tue, 21 Mar 2023 15:48:49 +0800
44-Subject: [PATCH] Deal with a font face at index 0 as Regular for Variable
55- fonts
44+Subject: [PATCH 5/6] qtbase: deal with a font face at index 0 as Regular for
55+ Variable fonts
6677Reference: https://bugreports.qt.io/browse/QTBUG-111994
88---
···3434 '';
35353636 meta = with lib; {
3737- inherit (src.homepage);
3737+ inherit (src.meta) homepage;
3838 description = "A FUSE-based filesystem that uses the p7zip library";
3939 longDescription = ''
4040 fuse-7z-ng is a FUSE file system that uses the p7zip
+1-1
pkgs/tools/inputmethods/fcitx5/fcitx5-qt.nix
···31313232 cmakeFlags = [
3333 # adding qt6 to buildInputs would result in error: detected mismatched Qt dependencies
3434- "-DCMAKE_PREFIX_PATH=${qt6.qtbase.dev}"
3434+ "-DCMAKE_PREFIX_PATH=${qt6.qtbase}"
3535 "-DENABLE_QT4=0"
3636 "-DENABLE_QT6=1"
3737 ];