mirror of
https://github.com/nix-community/home-manager.git
synced 2025-03-10 02:36:54 +00:00
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.
35 lines
836 B
Nix
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;
|
|
};
|
|
};
|
|
};
|
|
};
|
|
}
|