Skip to content

Commit

Permalink
feat: Add package description from Cargo.toml
Browse files Browse the repository at this point in the history
And enforce it
  • Loading branch information
srid committed Jul 28, 2024
1 parent cc32294 commit 363f20b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions nix/modules/crate.nix
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@

name = cargoToml.package.name;
version = cargoToml.package.version;
description = cargoToml.package.description
or (builtins.throw "Missing description in ${name}'s Cargo.toml");

# Crane builder
# NOTE: Is it worth exposing this entire attrset as a readOnly module
Expand All @@ -90,6 +92,7 @@
cargoArtifacts = crane-lib.buildDepsOnly args;
buildArgs = args // {
inherit cargoArtifacts;
meta.description = description;
} // crane.extraBuildArgs;
package = crane-lib.buildPackage buildArgs;

Expand Down

0 comments on commit 363f20b

Please sign in to comment.