Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ lib 2, stdenv 3, buildGoModule 4, fetchFromGitHub 5, installShellFiles 6}: 7 8buildGoModule rec { 9 pname = "lf"; 10 version = "30"; 11 12 src = fetchFromGitHub { 13 owner = "gokcehan"; 14 repo = "lf"; 15 rev = "r${version}"; 16 hash = "sha256-hlhmnkPm1x7uJMwUM/B02rXLffsXFbkxXYITKD3BERY="; 17 }; 18 19 vendorHash = "sha256-DYReTxH4SHnJERbiE6rOp5XqzN3NRbICt5iNeX8Jgt8="; 20 21 nativeBuildInputs = [ installShellFiles ]; 22 23 ldflags = [ "-s" "-w" "-X main.gVersion=r${version}" ]; 24 25 # Force the use of the pure-go implementation of the os/user library. 26 # Relevant issue: https://github.com/gokcehan/lf/issues/191 27 tags = lib.optionals (!stdenv.isDarwin) [ "osusergo" ]; 28 29 postInstall = '' 30 install -D --mode=444 lf.desktop $out/share/applications/lf.desktop 31 installManPage lf.1 32 installShellCompletion etc/lf.{bash,zsh,fish} 33 ''; 34 35 meta = with lib; { 36 description = "A terminal file manager written in Go and heavily inspired by ranger"; 37 longDescription = '' 38 lf (as in "list files") is a terminal file manager written in Go. It is 39 heavily inspired by ranger with some missing and extra features. Some of 40 the missing features are deliberately omitted since it is better if they 41 are handled by external tools. 42 ''; 43 homepage = "https://godoc.org/github.com/gokcehan/lf"; 44 changelog = "https://github.com/gokcehan/lf/releases/tag/r${version}"; 45 license = licenses.mit; 46 platforms = platforms.unix; 47 maintainers = with maintainers; [ dotlambda ]; 48 }; 49}