summary refs log tree commit diff
path: root/pkgs/shells/fish/oh-my-fish/default.nix
blob: 3ec4e3b12d78ef807d0584df026733114d3b50fa (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
{ lib
, stdenv
, fetchFromGitHub
, fish
, runtimeShell
, writeShellScript
}:

stdenv.mkDerivation rec {
  pname = "oh-my-fish";
  version = "7+unstable=2021-03-03";

  src = fetchFromGitHub {
    owner = pname;
    repo = pname;
    rev = "0b1396ad7962073fa25615bf03c43b53eddc2d56";
    hash = "sha256-lwMo4+PcYR9kYJPWK+ALiMfBdxFSgB2vjtSn8QrmmEA=";
  };

  buildInputs = [
    fish
  ];

  dontConfigure = true;
  dontBuild = true;

  installPhase = ''
    runHook preInstall

    mkdir -pv $out/bin $out/share/${pname}
    cp -vr * $out/share/${pname}

    cat << EOF > $out/bin/omf-install
    #!${runtimeShell}

    ${fish}/bin/fish \\
      $out/share/${pname}/bin/install \\
      --noninteractive \\
      --offline=$out/share/${pname}

    EOF
    chmod +x $out/bin/omf-install

    runHook PostInstall
  '';

  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 ];
    mainProgram = "omf-install";
    platforms = fish.meta.platforms;
  };
}
# TODO: customize the omf-install script