mirror of
https://github.com/nix-community/home-manager
synced 2024-11-27 21:49:48 +01:00
b3af91d293
There seems to be some changes on how wrapped binaries are implemented on nixpkgs. This broke the nnn tests since the tests were coupled with the old implementation. This commit fix the tests, and also make it less coupled by just testing if the bookmarks/plugins/environment variables are available.
55 lines
1.2 KiB
Nix
55 lines
1.2 KiB
Nix
{ config, lib, pkgs, ... }:
|
|
|
|
{
|
|
config = {
|
|
programs.nnn = {
|
|
enable = true;
|
|
bookmarks = {
|
|
d = "~/Documents";
|
|
D = "~/Downloads";
|
|
p = "~/Pictures";
|
|
v = "~/Videos";
|
|
};
|
|
package = pkgs.nnnDummy;
|
|
extraPackages = with pkgs; [ foo bar ];
|
|
plugins = {
|
|
src = ./plugins;
|
|
mappings = {
|
|
c = "fzcd";
|
|
f = "finder";
|
|
v = "imgview";
|
|
};
|
|
};
|
|
};
|
|
|
|
test.stubs = {
|
|
nnnDummy.buildScript = ''
|
|
runHook preInstall
|
|
|
|
mkdir -p "$out/bin"
|
|
touch "$out/bin/nnn"
|
|
chmod +x "$out/bin/nnn"
|
|
|
|
runHook postInstall
|
|
'';
|
|
foo = { name = "foo"; };
|
|
bar = { name = "bar"; };
|
|
};
|
|
|
|
nmt = {
|
|
description =
|
|
"Check if the binary is correctly wrapped and if the symlinks are made";
|
|
script = ''
|
|
assertDirectoryExists home-files/.config/nnn/plugins
|
|
|
|
for bookmark in 'export NNN_BMS' '~/Downloads' '~/Documents' '~/Pictures' '~/Videos'; do
|
|
assertFileRegex home-path/bin/nnn "$bookmark"
|
|
done
|
|
|
|
for plugin in 'export NNN_PLUG' 'fzcd' 'finder' 'imgview'; do
|
|
assertFileRegex home-path/bin/nnn "$plugin"
|
|
done
|
|
'';
|
|
};
|
|
};
|
|
}
|