2021-08-10 14:31:46 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, fish
|
|
|
|
, runtimeShell
|
|
|
|
, writeShellScript
|
|
|
|
}:
|
|
|
|
|
2022-07-14 12:49:19 +00:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2021-08-10 14:31:46 +00:00
|
|
|
pname = "oh-my-fish";
|
2022-07-14 12:49:19 +00:00
|
|
|
version = "unstable-2022-03-27";
|
2021-08-10 14:31:46 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2022-07-14 12:49:19 +00:00
|
|
|
owner = finalAttrs.pname;
|
|
|
|
repo = finalAttrs.pname;
|
|
|
|
rev = "d428b723c8c18fef3b2a00b8b8b731177f483ad8";
|
|
|
|
hash = "sha256-msItKEPe7uSUpDAfCfdYZjt5NyfM3KtOrLUTO9NGqlg=";
|
2021-08-10 14:31:46 +00:00
|
|
|
};
|
|
|
|
|
2022-05-18 14:49:53 +00:00
|
|
|
strictDeps = true;
|
2021-08-10 14:31:46 +00:00
|
|
|
buildInputs = [
|
|
|
|
fish
|
|
|
|
];
|
|
|
|
|
|
|
|
dontConfigure = true;
|
|
|
|
dontBuild = true;
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
|
2022-07-14 12:49:19 +00:00
|
|
|
mkdir -pv $out/bin $out/share/${finalAttrs.pname}
|
|
|
|
cp -vr * $out/share/${finalAttrs.pname}
|
2021-08-10 14:31:46 +00:00
|
|
|
|
|
|
|
cat << EOF > $out/bin/omf-install
|
|
|
|
#!${runtimeShell}
|
|
|
|
|
|
|
|
${fish}/bin/fish \\
|
2022-07-14 12:49:19 +00:00
|
|
|
$out/share/${finalAttrs.pname}/bin/install \\
|
2021-08-10 14:31:46 +00:00
|
|
|
--noninteractive \\
|
2022-07-14 12:49:19 +00:00
|
|
|
--offline=$out/share/${finalAttrs.pname}
|
2021-08-10 14:31:46 +00:00
|
|
|
|
|
|
|
EOF
|
|
|
|
chmod +x $out/bin/omf-install
|
|
|
|
|
2022-07-14 12:49:19 +00:00
|
|
|
runHook postInstall
|
2021-08-10 14:31:46 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://github.com/oh-my-fish/oh-my-fish";
|
|
|
|
description = "The Fish Shell Framework";
|
|
|
|
longDescription = ''
|
|
|
|
Oh My Fish provides core infrastructure to allow you to install packages
|
|
|
|
which extend or modify the look of your shell. It's fast, extensible and
|
|
|
|
easy to use.
|
|
|
|
'';
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ AndersonTorres ];
|
2022-04-27 09:35:20 +00:00
|
|
|
mainProgram = "omf-install";
|
2021-08-10 14:31:46 +00:00
|
|
|
platforms = fish.meta.platforms;
|
|
|
|
};
|
2022-07-14 12:49:19 +00:00
|
|
|
})
|
2021-08-10 14:31:46 +00:00
|
|
|
# TODO: customize the omf-install script
|