treewide: clean up 'meta = with' pattern

This commit was created by a combination of scripts and tools:
- an ast-grep script to prefix things in meta with `lib.`,
- a modified nixf-diagnose / nixf combination to remove unused `with
lib;`, and
- regular nixfmt.

Co-authored-by: Wolfgang Walther <walther@technowledgy.de>
This commit is contained in:
Ihar Hrachyshka
2025-12-10 18:09:49 +01:00
committed by Wolfgang Walther
co-authored by Wolfgang Walther
parent 8bbc115374
commit 567e8dfd8e
16759 changed files with 54499 additions and 54491 deletions
+10 -10
View File
@@ -29,15 +29,15 @@ rec {
inherit version;
inherit src;
meta = with lib; {
meta = {
homepage = "https://www.rust-lang.org/";
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
description = "Safe, concurrent, practical language";
mainProgram = "rustc";
maintainers = with maintainers; [ qknight ];
maintainers = with lib.maintainers; [ qknight ];
license = [
licenses.mit
licenses.asl20
lib.licenses.mit
lib.licenses.asl20
];
};
@@ -137,14 +137,14 @@ rec {
inherit version;
inherit src;
meta = with lib; {
meta = {
homepage = "https://doc.rust-lang.org/cargo/";
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
description = "Rust package manager";
maintainers = with maintainers; [ qknight ];
maintainers = with lib.maintainers; [ qknight ];
license = [
licenses.mit
licenses.asl20
lib.licenses.mit
lib.licenses.asl20
];
};
@@ -29,16 +29,16 @@ let
"--skip=test_wasm"
];
meta = with lib; {
meta = {
description = "Tool to make production Rust binaries auditable";
mainProgram = "cargo-auditable";
homepage = "https://github.com/rust-secure-code/cargo-auditable";
changelog = "https://github.com/rust-secure-code/cargo-auditable/blob/v${version}/cargo-auditable/CHANGELOG.md";
license = with licenses; [
license = with lib.licenses; [
mit # or
asl20
];
maintainers = with maintainers; [ RossSmyth ];
maintainers = with lib.maintainers; [ RossSmyth ];
broken = stdenv.hostPlatform != stdenv.buildPlatform;
};
};
+5 -5
View File
@@ -96,16 +96,16 @@ rustPlatform.buildRustPackage.override
runHook postInstallCheck
'';
meta = with lib; {
meta = {
homepage = "https://crates.io";
description = "Downloads your Rust project's dependencies and builds your project";
mainProgram = "cargo";
teams = [ teams.rust ];
teams = [ lib.teams.rust ];
license = [
licenses.mit
licenses.asl20
lib.licenses.mit
lib.licenses.asl20
];
platforms = platforms.unix;
platforms = lib.platforms.unix;
# https://github.com/alexcrichton/nghttp2-rs/issues/2
broken = stdenv.hostPlatform.isx86 && stdenv.buildPlatform != stdenv.hostPlatform;
};
+5 -5
View File
@@ -39,16 +39,16 @@ rustPlatform.buildRustPackage {
install_name_tool -add_rpath "${rustc.unwrapped}/lib" "$out/bin/cargo-clippy"
'';
meta = with lib; {
meta = {
homepage = "https://rust-lang.github.io/rust-clippy/";
description = "Bunch of lints to catch common mistakes and improve your Rust code";
mainProgram = "cargo-clippy";
maintainers = with maintainers; [ basvandijk ];
teams = [ teams.rust ];
license = with licenses; [
maintainers = with lib.maintainers; [ basvandijk ];
teams = [ lib.teams.rust ];
license = with lib.licenses; [
mit
asl20
];
platforms = platforms.unix;
platforms = lib.platforms.unix;
};
}
+4 -4
View File
@@ -442,13 +442,13 @@ stdenv.mkDerivation (finalAttrs: {
// lib.optionalAttrs stdenv.hostPlatform.isLinux { inherit firefox thunderbird; };
};
meta = with lib; {
meta = {
homepage = "https://www.rust-lang.org/";
description = "Safe, concurrent, practical language";
teams = [ teams.rust ];
teams = [ lib.teams.rust ];
license = [
licenses.mit
licenses.asl20
lib.licenses.mit
lib.licenses.asl20
];
platforms = rustc.targetPlatformsWithHostTools;
# If rustc can't target a platform, we also can't build rustc for
+3 -3
View File
@@ -51,15 +51,15 @@ rustPlatform.buildRustPackage {
--suffix PATH : ${lib.makeBinPath [ cargo ]}
'';
meta = with lib; {
meta = {
description = "Tool for formatting Rust code according to style guidelines";
homepage = "https://github.com/rust-lang-nursery/rustfmt";
license = with licenses; [
license = with lib.licenses; [
mit
asl20
];
mainProgram = "rustfmt";
maintainers = with maintainers; [
maintainers = with lib.maintainers; [
globin
basvandijk
];