micro: get rid of rec

+58 -54
+58 -54
pkgs/by-name/mi/micro/package.nix
··· 19 19 else stdenv.isLinux 20 20 }: 21 21 22 - buildGoModule rec { 23 - pname = "micro"; 24 - version = "2.0.13"; 22 + let 23 + self = buildGoModule { 24 + pname = "micro"; 25 + version = "2.0.13"; 25 26 26 - src = fetchFromGitHub { 27 - owner = "zyedidia"; 28 - repo = "micro"; 29 - rev = "v${version}"; 30 - hash = "sha256-fe+7RkUwCveBk14bYzg5uLGOqTVVJsrqixBQhCS79hY="; 31 - }; 27 + src = fetchFromGitHub { 28 + owner = "zyedidia"; 29 + repo = "micro"; 30 + rev = "v${self.version}"; 31 + hash = "sha256-fe+7RkUwCveBk14bYzg5uLGOqTVVJsrqixBQhCS79hY="; 32 + }; 32 33 33 - vendorHash = "sha256-ePhObvm3m/nT+7IyT0W6K+y+9UNkfd2kYjle2ffAd9Y="; 34 + vendorHash = "sha256-ePhObvm3m/nT+7IyT0W6K+y+9UNkfd2kYjle2ffAd9Y="; 34 35 35 - nativeBuildInputs = [ installShellFiles makeWrapper ]; 36 + nativeBuildInputs = [ installShellFiles makeWrapper ]; 36 37 37 - outputs = [ "out" "man" ]; 38 + outputs = [ "out" "man" ]; 38 39 39 - subPackages = [ "cmd/micro" ]; 40 + subPackages = [ "cmd/micro" ]; 40 41 41 - ldflags = let t = "github.com/zyedidia/micro/v2/internal"; in [ 42 - "-s" 43 - "-w" 44 - "-X ${t}/util.Version=${version}" 45 - "-X ${t}/util.CommitHash=${src.rev}" 46 - ]; 42 + ldflags = let t = "github.com/zyedidia/micro/v2/internal"; in [ 43 + "-s" 44 + "-w" 45 + "-X ${t}/util.Version=${self.version}" 46 + "-X ${t}/util.CommitHash=${self.src.rev}" 47 + ]; 47 48 48 - strictDeps = true; 49 + strictDeps = true; 49 50 50 - preBuild = '' 51 - GOOS= GOARCH= go generate ./runtime 51 + preBuild = '' 52 + GOOS= GOARCH= go generate ./runtime 52 53 ''; 53 54 54 - postInstall = '' 55 - installManPage assets/packaging/micro.1 56 - install -Dm444 assets/packaging/micro.desktop $out/share/applications/micro.desktop 57 - install -Dm644 assets/micro-logo-mark.svg $out/share/icons/hicolor/scalable/apps/micro.svg 55 + postInstall = '' 56 + installManPage assets/packaging/micro.1 57 + install -Dm444 assets/packaging/micro.desktop $out/share/applications/micro.desktop 58 + install -Dm644 assets/micro-logo-mark.svg $out/share/icons/hicolor/scalable/apps/micro.svg 58 59 ''; 59 60 60 - postFixup = let 61 - clipboardPackages = 62 - lib.optionals withXclip [ xclip ] ++ lib.optionals withWlClipboard [ wl-clipboard ]; 63 - in 64 - lib.optionalString (withXclip || withWlClipboard) 65 - '' 66 - wrapProgram "$out/bin/micro" \ 67 - --prefix PATH : "${lib.makeBinPath clipboardPackages}" 68 - ''; 61 + postFixup = let 62 + clipboardPackages = 63 + lib.optionals withXclip [ xclip ] ++ lib.optionals withWlClipboard [ wl-clipboard ]; 64 + in 65 + lib.optionalString (withXclip || withWlClipboard) 66 + ''wrapProgram "$out/bin/micro" \ 67 + --prefix PATH : "${lib.makeBinPath clipboardPackages}" 68 + ''; 69 69 70 - passthru = { 71 - tests = { 72 - expect = callPackage ./test-with-expect.nix { }; 70 + passthru = { 71 + tests = { 72 + expect = callPackage ./test-with-expect.nix { 73 + micro = self; 74 + }; 75 + }; 73 76 }; 74 - }; 75 77 76 - meta = { 77 - homepage = "https://micro-editor.github.io"; 78 - description = "Modern and intuitive terminal-based text editor"; 79 - longDescription = '' 80 - micro is a terminal-based text editor that aims to be easy to use and 81 - intuitive, while also taking advantage of the capabilities of modern 82 - terminals. 78 + meta = { 79 + homepage = "https://micro-editor.github.io"; 80 + description = "Modern and intuitive terminal-based text editor"; 81 + longDescription = '' 82 + micro is a terminal-based text editor that aims to be easy to use and 83 + intuitive, while also taking advantage of the capabilities of modern 84 + terminals. 83 85 84 - As its name indicates, micro aims to be somewhat of a successor to the 85 - nano editor by being easy to install and use. It strives to be enjoyable 86 - as a full-time editor for people who prefer to work in a terminal, or 87 - those who regularly edit files over SSH. 86 + As its name indicates, micro aims to be somewhat of a successor to the 87 + nano editor by being easy to install and use. It strives to be enjoyable 88 + as a full-time editor for people who prefer to work in a terminal, or 89 + those who regularly edit files over SSH. 88 90 ''; 89 - license = lib.licenses.mit; 90 - mainProgram = "micro"; 91 - maintainers = with lib.maintainers; [ AndersonTorres ]; 91 + license = lib.licenses.mit; 92 + mainProgram = "micro"; 93 + maintainers = with lib.maintainers; [ AndersonTorres ]; 94 + }; 92 95 }; 93 - } 96 + in 97 + self