2023-08-08 10:19:01 +00:00
|
|
|
{ pkgs, ... }:
|
2021-11-04 16:42:44 +00:00
|
|
|
|
|
|
|
{
|
2023-08-08 10:19:01 +00:00
|
|
|
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";
|
2021-11-04 16:42:44 +00:00
|
|
|
};
|
|
|
|
};
|
2023-08-08 10:19:01 +00:00
|
|
|
};
|
2021-11-04 16:42:44 +00:00
|
|
|
|
2023-08-08 10:19:01 +00:00
|
|
|
test.stubs = {
|
|
|
|
nnnDummy.buildScript = ''
|
|
|
|
runHook preInstall
|
2023-01-10 09:35:00 +00:00
|
|
|
|
2023-08-08 10:19:01 +00:00
|
|
|
mkdir -p "$out/bin"
|
|
|
|
touch "$out/bin/nnn"
|
|
|
|
chmod +x "$out/bin/nnn"
|
2021-11-04 16:42:44 +00:00
|
|
|
|
2023-08-08 10:19:01 +00:00
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
foo = { name = "foo"; };
|
|
|
|
bar = { name = "bar"; };
|
|
|
|
};
|
2021-11-04 16:42:44 +00:00
|
|
|
|
2023-08-08 10:19:01 +00:00
|
|
|
nmt = {
|
|
|
|
description =
|
|
|
|
"Check if the binary is correctly wrapped and if the symlinks are made";
|
|
|
|
script = ''
|
|
|
|
assertDirectoryExists home-files/.config/nnn/plugins
|
2021-11-04 16:42:44 +00:00
|
|
|
|
2023-08-08 10:19:01 +00:00
|
|
|
for bookmark in 'export NNN_BMS' '~/Downloads' '~/Documents' '~/Pictures' '~/Videos'; do
|
|
|
|
assertFileRegex home-path/bin/nnn "$bookmark"
|
|
|
|
done
|
2021-11-04 16:42:44 +00:00
|
|
|
|
2023-08-08 10:19:01 +00:00
|
|
|
for plugin in 'export NNN_PLUG' 'fzcd' 'finder' 'imgview'; do
|
|
|
|
assertFileRegex home-path/bin/nnn "$plugin"
|
|
|
|
done
|
|
|
|
'';
|
2021-11-04 16:42:44 +00:00
|
|
|
};
|
|
|
|
}
|