nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at devShellTools-shell 85 lines 1.7 kB view raw
1{ 2 lib, 3 stdenv, 4 fetchFromGitHub, 5 pkg-config, 6 makeWrapper, 7 copyDesktopItems, 8 makeDesktopItem, 9 ncurses, 10 libtermkey, 11 lua, 12 tre, 13 acl, 14 libselinux, 15}: 16 17let 18 luaEnv = lua.withPackages (ps: [ ps.lpeg ]); 19in 20stdenv.mkDerivation rec { 21 pname = "vis"; 22 version = "0.9"; 23 24 src = fetchFromGitHub { 25 rev = "v${version}"; 26 hash = "sha256-SYM3zlzhp3NdyOjtXc+pOiWY4/WA/Ax+qAWe18ggq3g="; 27 repo = "vis"; 28 owner = "martanne"; 29 }; 30 31 nativeBuildInputs = [ 32 pkg-config 33 makeWrapper 34 copyDesktopItems 35 ]; 36 37 buildInputs = [ 38 ncurses 39 libtermkey 40 luaEnv 41 tre 42 ] 43 ++ lib.optionals stdenv.hostPlatform.isLinux [ 44 acl 45 libselinux 46 ]; 47 48 postInstall = '' 49 wrapProgram $out/bin/vis \ 50 --prefix LUA_CPATH ';' "${luaEnv}/lib/lua/${lua.luaversion}/?.so" \ 51 --prefix LUA_PATH ';' "${luaEnv}/share/lua/${lua.luaversion}/?.lua" \ 52 --prefix VIS_PATH : "\$HOME/.config:$out/share/vis" 53 ''; 54 55 desktopItems = [ 56 (makeDesktopItem { 57 name = "vis"; 58 exec = "vis %U"; 59 type = "Application"; 60 icon = "accessories-text-editor"; 61 comment = meta.description; 62 desktopName = "vis"; 63 genericName = "Text editor"; 64 categories = [ 65 "Application" 66 "Development" 67 "IDE" 68 ]; 69 mimeTypes = [ 70 "text/plain" 71 "application/octet-stream" 72 ]; 73 startupNotify = false; 74 terminal = true; 75 }) 76 ]; 77 78 meta = with lib; { 79 description = "Vim like editor"; 80 homepage = "https://github.com/martanne/vis"; 81 license = licenses.isc; 82 maintainers = with maintainers; [ ramkromberg ]; 83 platforms = platforms.unix; 84 }; 85}