2021-10-06 01:14:52 +02:00
|
|
|
{ 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 = ''
|
2022-02-21 22:17:22 +01:00
|
|
|
runHook preInstall
|
|
|
|
|
2021-10-06 01:14:52 +02:00
|
|
|
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
|
|
|
|
|
2022-02-21 22:17:22 +01:00
|
|
|
for bookmark in 'export NNN_BMS' '~/Downloads' '~/Documents' '~/Pictures' '~/Videos'; do
|
|
|
|
assertFileRegex home-path/bin/nnn "$bookmark"
|
|
|
|
done
|
2021-10-06 01:14:52 +02:00
|
|
|
|
2022-02-21 22:17:22 +01:00
|
|
|
for plugin in 'export NNN_PLUG' 'fzcd' 'finder' 'imgview'; do
|
|
|
|
assertFileRegex home-path/bin/nnn "$plugin"
|
|
|
|
done
|
2021-10-06 01:14:52 +02:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|