2022-08-02 01:55:52 +03:00
|
|
|
{ cargoAudit
|
|
|
|
, fetchFromGitHub
|
|
|
|
, linkFarmFromDrvs
|
2023-09-04 03:33:25 +03:00
|
|
|
, runCommand
|
2022-08-02 01:55:52 +03:00
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
auditWith = pname: src: cargoAudit {
|
|
|
|
inherit src pname;
|
|
|
|
advisory-db = fetchFromGitHub {
|
|
|
|
owner = "rustsec";
|
|
|
|
repo = "advisory-db";
|
|
|
|
rev = "36df8a4efc6f2da4ccc7ced0d431136f473b2001";
|
|
|
|
sha256 = "sha256-9eSrCrsSNyl79JMH7LrlCpn9a8lYJ01daZNxUDBKMEo=";
|
|
|
|
};
|
|
|
|
};
|
2022-09-15 03:44:40 +03:00
|
|
|
|
|
|
|
simpleWithAuditToml = (auditWith "simple-with-audit-toml" ./simple-with-audit-toml);
|
|
|
|
|
2023-09-04 03:33:25 +03:00
|
|
|
containsAuditTomlInSrc = runCommand "containsAuditTomlInSrc" { } ''
|
2022-09-15 19:17:48 +03:00
|
|
|
if [[ -f ${simpleWithAuditToml.src}/.cargo/audit.toml ]]; then
|
2022-09-15 03:44:40 +03:00
|
|
|
touch $out
|
|
|
|
else
|
|
|
|
echo "missing audit.toml file"
|
|
|
|
false
|
|
|
|
fi
|
|
|
|
'';
|
2022-08-02 01:55:52 +03:00
|
|
|
in
|
|
|
|
linkFarmFromDrvs "cleanCargoToml" [
|
|
|
|
# Check against all different kinds of workspace types to make sure it works
|
|
|
|
(auditWith "simple" ./simple)
|
|
|
|
(auditWith "simple-git" ./simple-git)
|
|
|
|
|
2022-09-15 03:44:40 +03:00
|
|
|
simpleWithAuditToml
|
|
|
|
containsAuditTomlInSrc
|
|
|
|
|
2022-08-02 01:55:52 +03:00
|
|
|
(auditWith "gitRevNoRef" ./gitRevNoRef)
|
|
|
|
(auditWith "git-overlapping" ./git-overlapping)
|
|
|
|
|
|
|
|
(auditWith "workspace" ./workspace)
|
|
|
|
(auditWith "workspace-git" ./workspace-git)
|
|
|
|
(auditWith "workspace-root" ./workspace-root)
|
|
|
|
]
|