micro: nixfmt-rfc-style

This commit is contained in:
Anderson Torres 2024-07-31 11:59:09 -03:00
parent 7e8c970b4f
commit 8c98fdc5a0

View File

@ -1,25 +1,27 @@
{ lib
, stdenv
, buildGoModule
, fetchFromGitHub
, installShellFiles
, callPackage
, wl-clipboard
, xclip
, makeWrapper
# Boolean flags
, withXclip ? stdenv.isLinux
, withWlClipboard ?
{
lib,
stdenv,
buildGoModule,
fetchFromGitHub,
installShellFiles,
callPackage,
wl-clipboard,
xclip,
makeWrapper,
# Boolean flags
withXclip ? stdenv.isLinux,
withWlClipboard ?
if withWlclip != null then
lib.warn ''
withWlclip is deprecated and will be removed;
use withWlClipboard instead.
'' withWlclip
else stdenv.isLinux
# Deprecated options
# Remove them before or right after next version update from Nixpkgs or this
# package itself
, withWlclip ? null
else
stdenv.isLinux,
# Deprecated options
# Remove them before or right after next version update from Nixpkgs or this
# package itself
withWlclip ? null,
}:
let
@ -36,13 +38,23 @@ let
vendorHash = "sha256-ePhObvm3m/nT+7IyT0W6K+y+9UNkfd2kYjle2ffAd9Y=";
nativeBuildInputs = [ installShellFiles makeWrapper ];
nativeBuildInputs = [
installShellFiles
makeWrapper
];
outputs = [ "out" "man" ];
outputs = [
"out"
"man"
];
subPackages = [ "cmd/micro" ];
ldflags = let t = "github.com/zyedidia/micro/v2/internal"; in [
ldflags =
let
t = "github.com/zyedidia/micro/v2/internal";
in
[
"-s"
"-w"
"-X ${t}/util.Version=${self.version}"
@ -61,12 +73,14 @@ let
install -Dm644 assets/micro-logo-mark.svg $out/share/icons/hicolor/scalable/apps/micro.svg
'';
postFixup = let
postFixup =
let
clipboardPackages =
lib.optionals withXclip [ xclip ] ++ lib.optionals withWlClipboard [ wl-clipboard ];
lib.optionals withXclip [ xclip ]
++ lib.optionals withWlClipboard [ wl-clipboard ];
in
lib.optionalString (withXclip || withWlClipboard)
''wrapProgram "$out/bin/micro" \
lib.optionalString (withXclip || withWlClipboard) ''
wrapProgram "$out/bin/micro" \
--prefix PATH : "${lib.makeBinPath clipboardPackages}"
'';