diff options
author | Anderson Torres <torres.anderson.85@protonmail.com> | 2023-11-23 16:38:50 -0300 |
---|---|---|
committer | Anderson Torres <torres.anderson.85@protonmail.com> | 2023-11-25 20:11:49 -0300 |
commit | a95272e67f75b85e19b3796d99e56e9a435a2179 (patch) | |
tree | 2fe465f587b32837cc29aa0048dfca38981f54a1 /pkgs/shells/fish | |
parent | 33d2a40d6751477472a2eeb0531ef7ddbf1cc695 (diff) |
oh-my-fish: refactor
Diffstat (limited to 'pkgs/shells/fish')
-rw-r--r-- | pkgs/shells/fish/oh-my-fish/default.nix | 36 | ||||
-rw-r--r-- | pkgs/shells/fish/oh-my-fish/omf-install | 6 |
2 files changed, 24 insertions, 18 deletions
diff --git a/pkgs/shells/fish/oh-my-fish/default.nix b/pkgs/shells/fish/oh-my-fish/default.nix index 6c09599972d14..0801eb628347a 100644 --- a/pkgs/shells/fish/oh-my-fish/default.nix +++ b/pkgs/shells/fish/oh-my-fish/default.nix @@ -3,7 +3,7 @@ , fetchFromGitHub , fish , runtimeShell -, writeShellScript +, substituteAll }: stdenv.mkDerivation (finalAttrs: { @@ -11,41 +11,41 @@ stdenv.mkDerivation (finalAttrs: { version = "unstable-2022-03-27"; src = fetchFromGitHub { - owner = finalAttrs.pname; - repo = finalAttrs.pname; + owner = "oh-my-fish"; + repo = "oh-my-fish"; rev = "d428b723c8c18fef3b2a00b8b8b731177f483ad8"; hash = "sha256-msItKEPe7uSUpDAfCfdYZjt5NyfM3KtOrLUTO9NGqlg="; }; - strictDeps = true; buildInputs = [ fish ]; + strictDeps = true; + dontConfigure = true; dontBuild = true; installPhase = '' runHook preInstall - mkdir -pv $out/bin $out/share/${finalAttrs.pname} - cp -vr * $out/share/${finalAttrs.pname} - - cat << EOF > $out/bin/omf-install - #!${runtimeShell} + mkdir -pv $out/bin $out/share/oh-my-fish + cp -vr * $out/share/oh-my-fish - ${fish}/bin/fish \\ - $out/share/${finalAttrs.pname}/bin/install \\ - --noninteractive \\ - --offline=$out/share/${finalAttrs.pname} + cp -v ${substituteAll { + name = "omf-install"; + src = ./omf-install; + OMF = placeholder "out"; + inherit fish runtimeShell; + }} $out/bin/omf-install - EOF chmod +x $out/bin/omf-install + cat $out/bin/omf-install runHook postInstall ''; - meta = with lib; { + meta = { homepage = "https://github.com/oh-my-fish/oh-my-fish"; description = "The Fish Shell Framework"; longDescription = '' @@ -53,10 +53,10 @@ stdenv.mkDerivation (finalAttrs: { which extend or modify the look of your shell. It's fast, extensible and easy to use. ''; - license = licenses.mit; - maintainers = with maintainers; [ AndersonTorres ]; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ AndersonTorres ]; mainProgram = "omf-install"; - platforms = fish.meta.platforms; + inherit (fish.meta) platforms; }; }) # TODO: customize the omf-install script diff --git a/pkgs/shells/fish/oh-my-fish/omf-install b/pkgs/shells/fish/oh-my-fish/omf-install new file mode 100644 index 0000000000000..0b8be218e38a6 --- /dev/null +++ b/pkgs/shells/fish/oh-my-fish/omf-install @@ -0,0 +1,6 @@ +#!@runtimeShell@ + +@fish@/bin/fish \ + @OMF@/share/oh-my-fish/bin/install \ + --noninteractive \ + --offline=@OMF@/share/oh-my-fish |