1
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs synced 2024-10-18 12:50:18 -04:00
nixpkgs/pkgs/shells/zsh/grml-zsh-config/default.nix
Artturin e0464e4788 treewide: replace stdenv.is with stdenv.hostPlatform.is
In preparation for the deprecation of `stdenv.isX`.

These shorthands are not conducive to cross-compilation because they
hide the platforms.

Darwin might get cross-compilation for which the continued usage of `stdenv.isDarwin` will get in the way

One example of why this is bad and especially affects compiler packages
https://www.github.com/NixOS/nixpkgs/pull/343059

There are too many files to go through manually but a treewide should
get users thinking when they see a `hostPlatform.isX` in a place where it
doesn't make sense.

```
fd --type f "\.nix" | xargs sd --fixed-strings "stdenv.is" "stdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "stdenv'.is" "stdenv'.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "clangStdenv.is" "clangStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "gccStdenv.is" "gccStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "stdenvNoCC.is" "stdenvNoCC.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "inherit (stdenv) is" "inherit (stdenv.hostPlatform) is"
fd --type f "\.nix" | xargs sd --fixed-strings "buildStdenv.is" "buildStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "effectiveStdenv.is" "effectiveStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "originalStdenv.is" "originalStdenv.hostPlatform.is"
```
2024-09-25 00:04:37 +03:00

40 lines
1 KiB
Nix

{ stdenv, fetchFromGitHub, lib, zsh, coreutils, inetutils, procps, txt2tags }:
stdenv.mkDerivation rec {
pname = "grml-zsh-config";
version = "0.19.7";
src = fetchFromGitHub {
owner = "grml";
repo = "grml-etc-core";
rev = "v${version}";
sha256 = "sha256-XHuoafb1Wc8dUPrk/7jwYhlRQm76qcbQy2vHECm0Iuo=";
};
strictDeps = true;
nativeBuildInputs = [ txt2tags ];
buildInputs = [ zsh coreutils procps ]
++ lib.optional stdenv.hostPlatform.isLinux inetutils;
buildPhase = ''
cd doc
make
cd ..
'';
installPhase = ''
install -D -m644 etc/zsh/keephack $out/etc/zsh/keephack
install -D -m644 etc/zsh/zshrc $out/etc/zsh/zshrc
install -D -m644 doc/grmlzshrc.5 $out/share/man/man5/grmlzshrc.5
ln -s grmlzshrc.5.gz $out/share/man/man5/grml-zsh-config.5.gz
'';
meta = with lib; {
description = "grml's zsh setup";
homepage = "https://grml.org/zsh/";
license = with licenses; [ gpl2Plus gpl2Only ];
platforms = platforms.unix;
maintainers = with maintainers; [ msteen rvolosatovs ];
};
}