1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-03-10 10:47:02 +00:00
home-manager/tests/modules/programs/neovim/stubs.nix
Robert Helgesson 7a3f0b3b8d
tests: rework derivation stubbing
Instead of having to manually stub packages that should not be
downloaded we instead automatically stub all packages (except a small
list of whitelisted ones). Tests can re-introduce the real package by
using the `realPkgs` module argument.
2025-02-04 23:58:20 +01:00

35 lines
836 B
Nix

{ lib, pkgs, ... }:
{
test.stubs = {
neovim-unwrapped = {
name = "neovim-unwrapped";
outPath = null;
buildScript = ''
mkdir -p $out/bin $out/share/applications
echo "Name=Neovim" > $out/share/applications/nvim.desktop
cp ${pkgs.writeShellScript "nvim" "exit 0"} $out/bin/nvim
chmod +x $out/bin/nvim
'';
extraAttrs = {
lua = pkgs.writeTextDir "nix-support/utils.sh" ''
function _addToLuaPath() {
return 0
}
'';
meta = let stub = "stub";
in {
description = stub;
longDescription = stub;
homepage = stub;
mainProgram = stub;
license = [ stub ];
maintainers = [ stub ];
platforms = lib.platforms.all;
};
};
};
};
}