Merge pull request #180418 from AndersonTorres/MISC

Shell updates
This commit is contained in:
Rick van Schijndel 2022-07-08 08:16:41 +02:00 committed by GitHub
commit 0be91cefef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 36 additions and 28 deletions

View File

@ -2,26 +2,24 @@
, stdenv
, fetchFromGitHub
, fish
, bash
, runtimeShell
, writeShellScript
}:
stdenv.mkDerivation rec {
stdenv.mkDerivation (finalAttrs: {
pname = "oh-my-fish";
version = "7+unstable=2021-03-03";
version = "unstable-2022-03-27";
src = fetchFromGitHub {
owner = pname;
repo = pname;
rev = "0b1396ad7962073fa25615bf03c43b53eddc2d56";
hash = "sha256-lwMo4+PcYR9kYJPWK+ALiMfBdxFSgB2vjtSn8QrmmEA=";
owner = finalAttrs.pname;
repo = finalAttrs.pname;
rev = "d428b723c8c18fef3b2a00b8b8b731177f483ad8";
hash = "sha256-msItKEPe7uSUpDAfCfdYZjt5NyfM3KtOrLUTO9NGqlg=";
};
strictDeps = true;
buildInputs = [
fish
bash
];
dontConfigure = true;
@ -30,21 +28,21 @@ stdenv.mkDerivation rec {
installPhase = ''
runHook preInstall
mkdir -pv $out/bin $out/share/${pname}
cp -vr * $out/share/${pname}
mkdir -pv $out/bin $out/share/${finalAttrs.pname}
cp -vr * $out/share/${finalAttrs.pname}
cat << EOF > $out/bin/omf-install
#!${runtimeShell}
${fish}/bin/fish \\
$out/share/${pname}/bin/install \\
$out/share/${finalAttrs.pname}/bin/install \\
--noninteractive \\
--offline=$out/share/${pname}
--offline=$out/share/${finalAttrs.pname}
EOF
chmod +x $out/bin/omf-install
runHook PostInstall
runHook postInstall
'';
meta = with lib; {
@ -60,5 +58,5 @@ stdenv.mkDerivation rec {
mainProgram = "omf-install";
platforms = fish.meta.platforms;
};
}
})
# TODO: customize the omf-install script

View File

@ -1,25 +1,24 @@
{ lib
, stdenv
, fetchFromGitHub
, meson
, ncurses
, ninja
, pkg-config
, ncurses
, fetchFromGitHub
}:
stdenv.mkDerivation rec {
stdenv.mkDerivation (finalAttrs: {
pname = "loksh";
version = "7.0";
version = "7.1";
src = fetchFromGitHub {
owner = "dimkr";
repo = pname;
rev = version;
repo = finalAttrs.pname;
rev = finalAttrs.version;
fetchSubmodules = true;
sha256 = "sha256-q5RiY9/xEFCk+oHlxgNwDOB+TNjRWHKzU2kQH2LjCWY=";
sha256 = "sha256-APjY7wQUfUTXe3TRKWkDmMZuax0MpuU/KmgZfogdAGU=";
};
strictDeps = true;
nativeBuildInputs = [
meson
ninja
@ -30,21 +29,32 @@ stdenv.mkDerivation rec {
ncurses
];
strictDeps = true;
postInstall = ''
mv $out/bin/ksh $out/bin/loksh
mv $out/share/man/man1/ksh.1 $out/share/man/man1/loksh.1
mv $out/share/man/man1/sh.1 $out/share/man/man1/loksh-sh.1
'';
passthru = {
shellPath = "/bin/loksh";
};
meta = with lib; {
description = "Linux port of OpenBSD's ksh";
homepage = "https://github.com/dimkr/loksh";
description = "Linux port of OpenBSD's ksh";
longDescription = ''
loksh is a Linux port of OpenBSD's ksh.
Unlike other ports of ksh, loksh targets only one platform, follows
upstream closely and keeps changes to a minimum. loksh does not add any
extra features; this reduces the risk of introducing security
vulnerabilities and makes loksh a good fit for resource-constrained
systems.
'';
license = licenses.publicDomain;
maintainers = with maintainers; [ cameronnemo ];
platforms = platforms.linux;
};
}
passthru = {
shellPath = "/bin/loksh";
};
})