Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 20 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,13 @@
url = "github:oxalica/rust-overlay";
inputs.nixpkgs.follows = "nixpkgs";
};
advisory-db = {
url = "github:rustsec/advisory-db";
flake = false;
};
Comment on lines +14 to +17

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since nix builds are sandboxed, audit can't fetch the advisories at runtime, so we vendor them in instead. (The vendored artifact is only used for the cargoAudit check; it doesn't get included in the build output.)

};

outputs = { self, nixpkgs, flake-utils, crane, rust-overlay, ... }:
outputs = { self, nixpkgs, flake-utils, crane, rust-overlay, advisory-db, ... }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
Expand All @@ -36,6 +40,13 @@
src = lib.cleanSource ./.;
};

denySrc = lib.cleanSourceWith {
filter = path: type:
(craneLib.filterCargoSources path type) ||
(lib.hasSuffix "deny.toml" path);
src = lib.cleanSource ./.;
};

commonArgs = {
inherit src;
strictDeps = true;
Expand Down Expand Up @@ -79,6 +90,14 @@
fmt = craneLib.cargoFmt {
inherit src;
};
deny = craneLib.cargoDeny {
src = denySrc;
cargoDenyExtraArgs = "--all-features";
};
audit = craneLib.cargoAudit {
src = craneLib.cleanCargoSource ./.;
inherit advisory-db;
};
};

devShells.default = craneLib.devShell {
Expand Down
Loading