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