push sheeet
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s

This commit is contained in:
Dark Steveneq
2025-10-09 14:15:47 +02:00
commit 646b892680
49168 changed files with 5897842 additions and 0 deletions

View File

@@ -0,0 +1,98 @@
{
lib,
buildGoModule,
callPackage,
fetchFromGitHub,
installShellFiles,
stdenv,
# Deprecated options
# Remove them as soon as possible
withXclip ? null,
withWlClipboard ? null,
withWlclip ? null,
}:
let
self = buildGoModule {
pname = "micro";
version = "2.0.14";
src = fetchFromGitHub {
owner = "zyedidia";
repo = "micro";
rev = "v${self.version}";
hash = "sha256-avLVl6mn0xKgIy0BNnPZ8ypQhn8Ivj7gTgWbebDSjt0=";
};
vendorHash = "sha256-ePhObvm3m/nT+7IyT0W6K+y+9UNkfd2kYjle2ffAd9Y=";
nativeBuildInputs = [ installShellFiles ];
outputs = [
"out"
"man"
];
subPackages = [ "cmd/micro" ];
ldflags =
let
t = "github.com/zyedidia/micro/v2/internal";
in
[
"-s"
"-w"
"-X ${t}/util.Version=${self.version}"
"-X ${t}/util.CommitHash=${self.src.rev}"
];
strictDeps = true;
preBuild = ''
GOOS= GOARCH= go generate ./runtime
'';
postInstall = ''
installManPage assets/packaging/micro.1
install -Dm444 assets/packaging/micro.desktop $out/share/applications/micro.desktop
install -Dm644 assets/micro-logo-mark.svg $out/share/icons/hicolor/scalable/apps/micro.svg
'';
passthru = {
tests = lib.packagesFromDirectoryRecursive {
inherit callPackage;
directory = ./tests;
};
wrapper = callPackage ./wrapper.nix { micro = self; };
};
meta = {
homepage = "https://micro-editor.github.io";
changelog = "https://github.com/zyedidia/micro/releases/";
description = "Modern and intuitive terminal-based text editor";
longDescription = ''
micro is a terminal-based text editor that aims to be easy to use and
intuitive, while also taking advantage of the capabilities of modern
terminals.
As its name indicates, micro aims to be somewhat of a successor to the
nano editor by being easy to install and use. It strives to be enjoyable
as a full-time editor for people who prefer to work in a terminal, or
those who regularly edit files over SSH.
'';
license = lib.licenses.mit;
mainProgram = "micro";
maintainers = with lib.maintainers; [
pbsds
];
};
};
in
lib.warnIf (withXclip != null || withWlClipboard != null || withWlclip != null) ''
The options `withXclip`, `withWlClipboard`, `withWlclip` were removed. If
you are seeking for clipboard support, please consider the following
packages:
- `micro-with-wl-clipboard`
- `micro-with-xclip`
- `micro-full`
'' self

View File

@@ -0,0 +1,13 @@
spawn micro file.txt
expect "file.txt"
send "Hello world!"
expect "Hello world!"
# ctrl-q (exit)
send "\021"
expect "Save changes to file.txt before closing?"
send "y"
expect eof

View File

@@ -0,0 +1,26 @@
{
expect,
micro,
runCommand,
}:
let
expect-script = builtins.path {
name = "hello.tcl";
path = ./hello.tcl;
};
in
runCommand "micro-expect-hello-world"
{
nativeBuildInputs = [
expect
micro
];
}
# Micro needs a writable $HOME for throwing its configuration
''
export HOME=$(pwd)
expect -f ${expect-script}
grep "Hello world!" file.txt
cat file.txt > $out
''

View File

@@ -0,0 +1,6 @@
{ micro, testers }:
testers.testVersion {
package = micro;
command = "micro -version";
}

View File

@@ -0,0 +1,33 @@
{
lib,
micro,
makeWrapper,
symlinkJoin,
# configurable options
extraPackages ? [ ],
}:
symlinkJoin {
name = "micro-wrapped-${micro.version}";
inherit (micro) pname version outputs;
nativeBuildInputs = [ makeWrapper ];
paths = [ micro ];
postBuild = ''
${lib.concatMapStringsSep "\n" (
output: "ln --verbose --symbolic --no-target-directory ${micro.${output}} \$${output}"
) (lib.remove "out" micro.outputs)}
pushd $out/bin
for f in *; do
rm $f
makeWrapper ${micro}/bin/$f $f \
--prefix PATH ":" "${lib.makeBinPath extraPackages}"
done
popd
'';
meta = micro.meta;
}