3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/shells/zsh/spaceship-prompt/default.nix
Profpatsch 4a7f99d55d treewide: with stdenv.lib; in meta -> with lib;
Part of: https://github.com/NixOS/nixpkgs/issues/108938

meta = with stdenv.lib;

is a widely used pattern. We want to slowly remove
the `stdenv.lib` indirection and encourage people
to use `lib` directly. Thus let’s start with the meta
field.

This used a rewriting script to mostly automatically
replace all occurances of this pattern, and add the
`lib` argument to the package header if it doesn’t
exist yet.

The script in its current form is available at
https://cs.tvl.fyi/depot@2f807d7f141068d2d60676a89213eaa5353ca6e0/-/blob/users/Profpatsch/nixpkgs-rewriter/default.nix
2021-01-11 10:38:22 +01:00

36 lines
1.4 KiB
Nix

{ lib, stdenv, fetchFromGitHub }:
stdenv.mkDerivation rec {
pname = "spaceship-prompt";
version = "3.11.2";
src = fetchFromGitHub {
owner = "denysdovhan";
repo = "spaceship-prompt";
sha256 = "1q7m9mmg82n4fddfz01y95d5n34xnzhrnn1lli0vih39sgmzim9b";
rev = "v${version}";
};
installPhase = ''
install -D -m644 LICENSE.md "$out/share/licenses/spaceship-prompt/LICENSE"
install -D -m644 README.md "$out/share/doc/spaceship-prompt/README.md"
find docs -type f -exec install -D -m644 {} "$out/share/doc/spaceship-prompt/{}" \;
find lib -type f -exec install -D -m644 {} "$out/lib/spaceship-prompt/{}" \;
find scripts -type f -exec install -D -m644 {} "$out/lib/spaceship-prompt/{}" \;
find sections -type f -exec install -D -m644 {} "$out/lib/spaceship-prompt/{}" \;
install -D -m644 spaceship.zsh "$out/lib/spaceship-prompt/spaceship.zsh"
install -d "$out/share/zsh/themes/"
ln -s "$out/lib/spaceship-prompt/spaceship.zsh" "$out/share/zsh/themes/spaceship.zsh-theme"
install -d "$out/share/zsh/site-functions/"
ln -s "$out/lib/spaceship-prompt/spaceship.zsh" "$out/share/zsh/site-functions/prompt_spaceship_setup"
'';
meta = with lib; {
description = "Zsh prompt for Astronauts";
homepage = "https://github.com/denysdovhan/spaceship-prompt/";
license = licenses.mit;
platforms = platforms.linux ++ platforms.darwin;
maintainers = with maintainers; [ nyanloutre ];
};
}