fork/home-manager

git clone https://git.julia.blue/fork/home-manager

Robert Helgessontests: some minor cleanupsaf715ed8

master
1.1 KiB53 linesraw
1{ pkgs, ... }:
2
3{
4  programs.nnn = {
5    enable = true;
6    bookmarks = {
7      d = "~/Documents";
8      D = "~/Downloads";
9      p = "~/Pictures";
10      v = "~/Videos";
11    };
12    package = pkgs.nnnDummy;
13    extraPackages = with pkgs; [ foo bar ];
14    plugins = {
15      src = ./plugins;
16      mappings = {
17        c = "fzcd";
18        f = "finder";
19        v = "imgview";
20      };
21    };
22  };
23
24  test.stubs = {
25    nnnDummy.buildScript = ''
26      runHook preInstall
27
28      mkdir -p "$out/bin"
29      touch "$out/bin/nnn"
30      chmod +x "$out/bin/nnn"
31
32      runHook postInstall
33    '';
34    foo = { name = "foo"; };
35    bar = { name = "bar"; };
36  };
37
38  nmt = {
39    description =
40      "Check if the binary is correctly wrapped and if the symlinks are made";
41    script = ''
42      assertDirectoryExists home-files/.config/nnn/plugins
43
44      for bookmark in 'export NNN_BMS' '~/Downloads' '~/Documents' '~/Pictures' '~/Videos'; do
45        assertFileRegex home-path/bin/nnn "$bookmark"
46      done
47
48      for plugin in 'export NNN_PLUG' 'fzcd' 'finder' 'imgview'; do
49        assertFileRegex home-path/bin/nnn "$plugin"
50      done
51    '';
52  };
53}