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
|
2024-05-04 22:36:42 +03:00
|
|
|
auditWith = src: cargoAudit {
|
|
|
|
inherit src;
|
2022-08-02 01:55:52 +03:00
|
|
|
advisory-db = fetchFromGitHub {
|
|
|
|
owner = "rustsec";
|
|
|
|
repo = "advisory-db";
|
|
|
|
rev = "36df8a4efc6f2da4ccc7ced0d431136f473b2001";
|
|
|
|
sha256 = "sha256-9eSrCrsSNyl79JMH7LrlCpn9a8lYJ01daZNxUDBKMEo=";
|
|
|
|
};
|
|
|
|
};
|
2022-09-15 03:44:40 +03:00
|
|
|
|
2024-05-04 22:36:42 +03:00
|
|
|
simpleWithAuditToml = (auditWith ./simple-with-audit-toml);
|
2022-09-15 03:44:40 +03:00
|
|
|
|
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
|
2024-05-04 22:36:42 +03:00
|
|
|
(auditWith ./simple)
|
|
|
|
(auditWith ./simple-git)
|
2022-08-02 01:55:52 +03:00
|
|
|
|
2022-09-15 03:44:40 +03:00
|
|
|
simpleWithAuditToml
|
|
|
|
containsAuditTomlInSrc
|
|
|
|
|
2024-05-04 22:36:42 +03:00
|
|
|
(auditWith ./gitRevNoRef)
|
|
|
|
(auditWith ./git-overlapping)
|
2022-08-02 01:55:52 +03:00
|
|
|
|
2024-05-04 22:36:42 +03:00
|
|
|
(auditWith ./workspace)
|
|
|
|
(auditWith ./workspace-git)
|
|
|
|
(auditWith ./workspace-root)
|
2022-08-02 01:55:52 +03:00
|
|
|
]
|