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
This commit is contained in:
Profpatsch
2021-01-11 10:38:22 +01:00
parent e87aef06e0
commit 4a7f99d55d
6869 changed files with 13585 additions and 13580 deletions
+2 -2
View File
@@ -1,4 +1,4 @@
{ stdenv, fetchFromGitHub, makeWrapper }:
{ lib, stdenv, fetchFromGitHub, makeWrapper }:
stdenv.mkDerivation rec {
pname = "any-nix-shell";
@@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
wrapProgram $out/bin/any-nix-shell --prefix PATH ":" $out/bin
'';
meta = with stdenv.lib; {
meta = with lib; {
description = "fish and zsh support for nix-shell";
license = licenses.mit;
homepage = "https://github.com/haslersn/any-nix-shell";
+2 -2
View File
@@ -1,4 +1,4 @@
{ stdenv, buildPackages
{ lib, stdenv, buildPackages
, fetchurl, binutils ? null, bison, autoconf, util-linux
# patch for cygwin requires readline support
@@ -111,7 +111,7 @@ stdenv.mkDerivation rec {
rm -rf "$out/share" "$out/bin/bashbug"
'';
meta = with stdenv.lib; {
meta = with lib; {
homepage = "https://www.gnu.org/software/bash/";
description =
"GNU Bourne-Again Shell, the de facto standard shell on Linux" +
+2 -2
View File
@@ -1,4 +1,4 @@
{ stdenv
{ lib, stdenv
, buildPackages
, fetchurl
, binutils ? null
@@ -102,7 +102,7 @@ stdenv.mkDerivation rec {
rm -rf "$out/share" "$out/bin/bashbug"
'';
meta = with stdenv.lib; {
meta = with lib; {
homepage = "https://www.gnu.org/software/bash/";
description =
"GNU Bourne-Again Shell, the de facto standard shell on Linux" +
+2 -2
View File
@@ -1,4 +1,4 @@
{ stdenv, fetchurl
{ lib, stdenv, fetchurl
, fetchpatch
, autoreconfHook
, perl
@@ -63,7 +63,7 @@ stdenv.mkDerivation rec {
sed -i -e 's/readlink -f/readlink/g' bash_completion completions/*
'';
meta = with stdenv.lib; {
meta = with lib; {
homepage = "https://github.com/scop/bash-completion";
description = "Programmable completion for the bash shell";
license = licenses.gpl2Plus;
@@ -1,4 +1,4 @@
{ stdenv, fetchFromGitHub }:
{ lib, stdenv, fetchFromGitHub }:
stdenv.mkDerivation rec {
version = "0.6.8";
@@ -26,7 +26,7 @@ stdenv.mkDerivation rec {
done
'';
meta = with stdenv.lib; {
meta = with lib; {
homepage = "https://github.com/hedning/nix-bash-completions";
description = "Bash completions for Nix, NixOS, and NixOps";
license = licenses.bsd3;
+2 -2
View File
@@ -1,4 +1,4 @@
{ stdenv, buildPackages, autoreconfHook, fetchurl }:
{ lib, stdenv, buildPackages, autoreconfHook, fetchurl }:
stdenv.mkDerivation rec {
pname = "dash";
@@ -23,7 +23,7 @@ stdenv.mkDerivation rec {
depsBuildBuild = [ buildPackages.stdenv.cc ];
nativeBuildInputs = stdenv.lib.optional stdenv.isDarwin autoreconfHook;
meta = with stdenv.lib; {
meta = with lib; {
homepage = "http://gondor.apana.org.au/~herbert/dash/";
description = "A POSIX-compliant implementation of /bin/sh that aims to be as small as possible";
platforms = platforms.unix;
+2 -2
View File
@@ -1,4 +1,4 @@
{ stdenv, fetchFromGitHub, autoconf, automake, pkgconfig,
{ lib, stdenv, fetchFromGitHub, autoconf, automake, pkgconfig,
libtool, check, bison, git, gperf,
perl, texinfo, help2man, gettext, ncurses
}:
@@ -35,7 +35,7 @@ stdenv.mkDerivation {
enableParallelBuilding = true;
meta = with stdenv.lib; {
meta = with lib; {
description = "The Directed Graph Shell";
homepage = "http://www.dmst.aueb.gr/dds/sw/dgsh";
license = with licenses; asl20;
+2 -2
View File
@@ -1,4 +1,4 @@
{ stdenv, buildGoModule, fetchFromGitHub }:
{ lib, stdenv, buildGoModule, fetchFromGitHub }:
buildGoModule rec {
pname = "elvish";
@@ -19,7 +19,7 @@ buildGoModule rec {
doCheck = false;
meta = with stdenv.lib; {
meta = with lib; {
description = "A friendly and expressive command shell";
longDescription = ''
Elvish is a friendly interactive shell and an expressive programming
+2 -2
View File
@@ -1,4 +1,4 @@
{ stdenv, fetchurl, readline, yacc }:
{ lib, stdenv, fetchurl, readline, yacc }:
let
version = "0.9.1";
@@ -24,7 +24,7 @@ stdenv.mkDerivation {
configureFlags = [ "--with-readline" ];
meta = with stdenv.lib; {
meta = with lib; {
description = "An extensible shell with higher order functions";
longDescription =
''
+2 -2
View File
@@ -1,4 +1,4 @@
{ stdenv, fetchFromGitHub, rustPlatform, Security }:
{ lib, stdenv, fetchFromGitHub, rustPlatform, Security }:
rustPlatform.buildRustPackage rec {
pname = "ion";
@@ -13,7 +13,7 @@ rustPlatform.buildRustPackage rec {
cargoSha256 = "1ph3r3vspy700mb8pica8478v9arqz07k2nzpbrdkdkqgfcwlgcg";
meta = with stdenv.lib; {
meta = with lib; {
description = "Modern system shell with simple (and powerful) syntax";
homepage = "https://gitlab.redox-os.org/redox-os/ion";
license = licenses.mit;
+2 -2
View File
@@ -1,4 +1,4 @@
{ stdenv, fetchFromGitHub, autoreconfHook, pkgconfig, editline }:
{ lib, stdenv, fetchFromGitHub, autoreconfHook, pkgconfig, editline }:
stdenv.mkDerivation rec {
pname = "jush";
@@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
passthru.shellPath = "/bin/jush";
meta = with stdenv.lib; {
meta = with lib; {
description = "just a useless shell";
homepage = "https://github.com/troglobit/jush";
license = licenses.isc;
+2 -2
View File
@@ -1,4 +1,4 @@
{ stdenv, meson, ninja, fetchFromGitHub, which, python, fetchpatch
{ lib, stdenv, meson, ninja, fetchFromGitHub, which, python, fetchpatch
, libiconv }:
stdenv.mkDerivation rec {
@@ -23,7 +23,7 @@ stdenv.mkDerivation rec {
buildInputs = [ libiconv ];
meta = with stdenv.lib; {
meta = with lib; {
description = "KornShell Command And Programming Language";
longDescription = ''
The KornShell language was designed and developed by David G. Korn at
+2 -2
View File
@@ -1,4 +1,4 @@
{ stdenv, fetchFromGitHub }:
{ lib, stdenv, fetchFromGitHub }:
stdenv.mkDerivation rec {
pname = "liquidprompt";
@@ -22,7 +22,7 @@ stdenv.mkDerivation rec {
$out/share/zsh/plugins/liquidprompt/liquidprompt
'';
meta = with stdenv.lib; {
meta = with lib; {
description = "A full-featured & carefully designed adaptive prompt for Bash & Zsh";
homepage = "https://github.com/nojhan/liquidprompt";
license = licenses.agpl3;
+2 -2
View File
@@ -1,4 +1,4 @@
{ stdenv, fetchurl }:
{ lib, stdenv, fetchurl }:
stdenv.mkDerivation rec {
pname = "mksh";
@@ -22,7 +22,7 @@ stdenv.mkDerivation rec {
install -D -m 644 dot.mkshrc $out/share/mksh/mkshrc
'';
meta = with stdenv.lib; {
meta = with lib; {
description = "MirBSD Korn Shell";
longDescription = ''
The MirBSD Korn Shell is a DFSG-free and OSD-compliant (and OSI
+2 -2
View File
@@ -1,4 +1,4 @@
{ stdenv, fetchFromGitHub, meson, ninja, pkgconfig, readline }:
{ lib, stdenv, fetchFromGitHub, meson, ninja, pkgconfig, readline }:
stdenv.mkDerivation rec {
pname = "mrsh";
@@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
doCheck = true;
meta = with stdenv.lib; {
meta = with lib; {
description = "A minimal POSIX shell";
homepage = "https://mrsh.sh";
license = licenses.mit;
+1 -1
View File
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
sha256 = "0lny550qfanysc4pqs0mxxx8zyz6plv9ll8y05gz0xmq9vx5384r";
};
meta = with stdenv.lib; {
meta = with lib; {
description = "Portable OpenBSD ksh, based on the Public Domain Korn Shell (pdksh)";
homepage = "https://github.com/ibara/oksh";
license = licenses.publicDomain;
+2 -2
View File
@@ -1,4 +1,4 @@
{ stdenv, fetchFromGitHub, buildDotnetPackage }:
{ lib, stdenv, fetchFromGitHub, buildDotnetPackage }:
buildDotnetPackage {
baseName = "pash";
@@ -15,7 +15,7 @@ buildDotnetPackage {
outputFiles = [ "Source/PashConsole/bin/Release/*" ];
meta = with stdenv.lib; {
meta = with lib; {
description = "An open source implementation of Windows PowerShell";
homepage = "https://github.com/Pash-Project/Pash";
maintainers = [ maintainers.fornever maintainers.vrthra ];
+2 -2
View File
@@ -1,4 +1,4 @@
{ stdenv, fetchurl, autoreconfHook
{ lib, stdenv, fetchurl, autoreconfHook
, ncurses #acinclude.m4 wants headers for tgetent().
, historySupport ? false
, readline ? null
@@ -31,7 +31,7 @@ stdenv.mkDerivation rec {
shellPath = "/bin/rc";
};
meta = with stdenv.lib; {
meta = with lib; {
description = "The Plan 9 shell";
longDescription = "Byron Rakitzis' UNIX reimplementation of Tom Duff's Plan 9 shell.";
homepage = "http://tobold.org/article/rc";
+2 -2
View File
@@ -1,4 +1,4 @@
{ stdenv, fetchurl, fetchpatch
{ lib, stdenv, fetchurl, fetchpatch
, ncurses
}:
@@ -24,7 +24,7 @@ stdenv.mkDerivation rec {
sha256 = "1qc6ydxhdfizsbkaxhpn3wib8sfphrw10xnnsxx2prvzg9g2zp67";
});
meta = with stdenv.lib; {
meta = with lib; {
description = "An enhanced version of the Berkeley UNIX C shell (csh)";
longDescription = ''
tcsh is an enhanced but completely compatible version of the
+2 -2
View File
@@ -1,4 +1,4 @@
{ stdenv
{ lib, stdenv
, fetchFromGitHub
, python3Packages
, glibcLocales
@@ -43,7 +43,7 @@ python3Packages.buildPythonApplication rec {
propagatedBuildInputs = with python3Packages; [ ply prompt_toolkit pygments ];
meta = with stdenv.lib; {
meta = with lib; {
description = "A Python-ish, BASHwards-compatible shell";
homepage = "https://xon.sh/";
changelog = "https://github.com/xonsh/xonsh/releases/tag/${version}";
+2 -2
View File
@@ -1,4 +1,4 @@
{ stdenv, fetchFromGitHub, fzf }:
{ lib, stdenv, fetchFromGitHub, fzf }:
stdenv.mkDerivation rec {
pname = "fzf-zsh-unstable";
@@ -27,7 +27,7 @@ stdenv.mkDerivation rec {
install -Dm0644 fzf-zsh.plugin.zsh $out/share/zsh/plugins/fzf-zsh/fzf-zsh.plugin.zsh
'';
meta = with stdenv.lib; {
meta = with lib; {
homepage = "https://github.com/wyntau/fzf-zsh";
description = "wrap fzf to use in oh-my-zsh";
license = licenses.mit;
@@ -1,4 +1,4 @@
{ stdenv, fetchFromGitHub }:
{ lib, stdenv, fetchFromGitHub }:
stdenv.mkDerivation rec {
pname = "gradle-completion";
@@ -26,7 +26,7 @@ stdenv.mkDerivation rec {
runHook postInstall
'';
meta = with stdenv.lib; {
meta = with lib; {
description = "Gradle tab completion for bash and zsh";
homepage = "https://github.com/gradle/gradle-completion";
license = licenses.mit;
+1 -1
View File
@@ -31,7 +31,7 @@ stdenv.mkDerivation rec {
ln -s grmlzshrc.5.gz $out/share/man/man5/grml-zsh-config.5.gz
'';
meta = with stdenv.lib; {
meta = with lib; {
description = "grml's zsh setup";
homepage = "https://grml.org/zsh/";
license = licenses.gpl2;
@@ -1,4 +1,4 @@
{ stdenv, fetchFromGitHub }:
{ lib, stdenv, fetchFromGitHub }:
stdenv.mkDerivation {
pname = "lambda-mod-zsh-theme-unstable";
@@ -15,7 +15,7 @@ stdenv.mkDerivation {
install -Dm0644 lambda-mod.zsh-theme $out/share/zsh/themes/lambda-mod.zsh-theme
'';
meta = with stdenv.lib; {
meta = with lib; {
description = "A ZSH theme optimized for people who use Git & Unicode-compatible fonts and terminals";
homepage = "https://github.com/halfo/lambda-mod-zsh-theme/";
license = licenses.mit;
@@ -1,4 +1,4 @@
{ stdenv, fetchFromGitHub }:
{ lib, stdenv, fetchFromGitHub }:
let
version = "0.4.4";
@@ -21,7 +21,7 @@ stdenv.mkDerivation {
cp *.zsh $out/share/zsh/plugins/nix
'';
meta = with stdenv.lib; {
meta = with lib; {
homepage = "https://github.com/spwhitt/nix-zsh-completions";
description = "ZSH completions for Nix, NixOS, and NixOps";
license = licenses.bsd3;
+2 -2
View File
@@ -1,7 +1,7 @@
# This script was inspired by the ArchLinux User Repository package:
#
# https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=oh-my-zsh-git
{ stdenv, fetchFromGitHub, nixosTests, writeScript, common-updater-scripts, git
{ lib, stdenv, fetchFromGitHub, nixosTests, writeScript, common-updater-scripts, git
, nix, nixfmt, jq, coreutils, gnused, curl, cacert }:
stdenv.mkDerivation rec {
@@ -102,7 +102,7 @@ stdenv.mkDerivation rec {
'';
};
meta = with stdenv.lib; {
meta = with lib; {
description = "A framework for managing your zsh configuration";
longDescription = ''
Oh My Zsh is a framework for managing your zsh configuration.
+2 -2
View File
@@ -1,4 +1,4 @@
{ stdenv, fetchFromGitHub }:
{ lib, stdenv, fetchFromGitHub }:
stdenv.mkDerivation rec {
pname = "spaceship-prompt";
@@ -25,7 +25,7 @@ stdenv.mkDerivation rec {
ln -s "$out/lib/spaceship-prompt/spaceship.zsh" "$out/share/zsh/site-functions/prompt_spaceship_setup"
'';
meta = with stdenv.lib; {
meta = with lib; {
description = "Zsh prompt for Astronauts";
homepage = "https://github.com/denysdovhan/spaceship-prompt/";
license = licenses.mit;
@@ -1,4 +1,4 @@
{ stdenv, fetchFromGitHub, zsh }:
{ lib, stdenv, fetchFromGitHub, zsh }:
# To make use of this derivation, use the `programs.zsh.enableAutoSuggestions` option
@@ -20,7 +20,7 @@ stdenv.mkDerivation rec {
$out/share/zsh-autosuggestions/zsh-autosuggestions.zsh
'';
meta = with stdenv.lib; {
meta = with lib; {
description = "Fish shell autosuggestions for Zsh";
homepage = "https://github.com/zsh-users/zsh-autosuggestions";
license = licenses.mit;
+2 -2
View File
@@ -1,4 +1,4 @@
{ stdenv, fetchFromGitHub }:
{ lib, stdenv, fetchFromGitHub }:
# To make use of this plugin, need to add
# programs.zsh.interactiveShellInit = ''
@@ -25,7 +25,7 @@ stdenv.mkDerivation {
install -Dm0444 $src/command-time.plugin.zsh --target-directory=$out/share/zsh/plugins/command-time
'';
meta = with stdenv.lib; {
meta = with lib; {
description = "Plugin that output time: xx after long commands";
homepage = "https://github.com/popstas/zsh-command-time";
license = licenses.mit;
+2 -2
View File
@@ -1,4 +1,4 @@
{ stdenv, fetchFromGitHub, perl }:
{ lib, stdenv, fetchFromGitHub, perl }:
let
version = "1.4";
@@ -25,7 +25,7 @@ in stdenv.mkDerivation {
cp deer $out/share/zsh/site-functions/
'';
meta = with stdenv.lib; {
meta = with lib; {
description = "Ranger-like file navigation for zsh";
homepage = "https://github.com/Vifon/deer";
license = licenses.gpl3Plus;
+2 -2
View File
@@ -1,4 +1,4 @@
{ stdenv, fetchFromGitHub, pkgs }:
{ lib, stdenv, fetchFromGitHub, pkgs }:
# To make use of this derivation, use
# `programs.zsh.interactiveShellInit = "source ${pkgs.zsh-nix-shell}/share/zsh-nix-shell/nix-shell.plugin.zsh";`
@@ -19,7 +19,7 @@ stdenv.mkDerivation rec {
install -D scripts/* --target-directory=$out/share/zsh-nix-shell/scripts
'';
meta = with stdenv.lib; {
meta = with lib; {
description = "zsh plugin that lets you use zsh in nix-shell shell";
homepage = src.meta.homepage;
license = licenses.bsd3;
+2 -2
View File
@@ -1,4 +1,4 @@
{ stdenv, fetchFromGitHub }:
{ lib, stdenv, fetchFromGitHub }:
stdenv.mkDerivation rec {
pname = "zsh-prezto";
@@ -24,7 +24,7 @@ stdenv.mkDerivation rec {
mkdir -p $out
cp ./* $out/ -R
'';
meta = with stdenv.lib; {
meta = with lib; {
description = "Prezto is the configuration framework for Zsh; it enriches the command line interface environment with sane defaults, aliases, functions, auto completion, and prompt themes";
homepage = "https://github.com/sorin-ionescu/prezto";
license = licenses.mit;
@@ -1,4 +1,4 @@
{ stdenv, fetchFromGitHub, zsh }:
{ lib, stdenv, fetchFromGitHub, zsh }:
# To make use of this derivation, use the `programs.zsh.enableSyntaxHighlighting` option
@@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
installFlags = [ "PREFIX=$(out)" ];
meta = with stdenv.lib; {
meta = with lib; {
description = "Fish shell like syntax highlighting for Zsh";
homepage = "https://github.com/zsh-users/zsh-syntax-highlighting";
license = licenses.bsd3;
@@ -1,4 +1,4 @@
{ stdenv, fetchFromGitHub }:
{ lib, stdenv, fetchFromGitHub }:
stdenv.mkDerivation rec {
pname = "zsh-you-should-use";
@@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
install -D you-should-use.plugin.zsh $out/share/zsh/plugins/you-should-use/you-should-use.plugin.zsh
'';
meta = with stdenv.lib; {
meta = with lib; {
homepage = "https://github.com/MichaelAquilina/zsh-you-should-use";
license = licenses.gpl3;
description = "ZSH plugin that reminds you to use existing aliases for commands you just typed";