flake.nix: replace naersk with buildRustPackage

This commit is contained in:
Astro 2024-09-06 23:54:46 +02:00
parent 20a44af934
commit 5b1b10eb70
2 changed files with 10 additions and 38 deletions

View File

@ -1,26 +1,5 @@
{
"nodes": {
"naersk": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1713520724,
"narHash": "sha256-CO8MmVDmqZX2FovL75pu5BvwhW+Vugc7Q6ze7Hj8heI=",
"owner": "nix-community",
"repo": "naersk",
"rev": "c5037590290c6c7dae2e42e7da1e247e54ed2d49",
"type": "github"
},
"original": {
"owner": "nix-community",
"ref": "master",
"repo": "naersk",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1714656196,
@ -39,7 +18,6 @@
},
"root": {
"inputs": {
"naersk": "naersk",
"nixpkgs": "nixpkgs",
"utils": "utils"
}

View File

@ -2,27 +2,21 @@
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
utils.url = "github:numtide/flake-utils";
naersk = {
url = "github:nix-community/naersk/master";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, utils, naersk }:
outputs = { self, nixpkgs, utils }:
let
inherit (nixpkgs) lib;
deadnixLambda = pkgs:
let
naersk-lib = pkgs.callPackage naersk { };
in
naersk-lib.buildPackage {
pkgs.rustPlatform.buildRustPackage {
pname = "deadnix";
root = ./.;
checkInputs = [ pkgs.rustPackages.clippy ];
version = self.sourceInfo.lastModifiedDate;
src = ./.;
cargoLock.lockFile = ./Cargo.lock;
nativeCheckInputs = [ pkgs.clippy ];
doCheck = true;
cargoTestCommands = x:
x ++ [
''cargo clippy --all --all-features --tests -- \
postCheck = ''
cargo clippy --all --all-features --tests -- \
-D clippy::pedantic \
-D warnings \
-A clippy::module-name-repetitions \
@ -31,8 +25,8 @@
-A clippy::cast-possible-truncation \
-A clippy::nonminimal_bool \
-A clippy::must-use-candidate \
-A clippy::missing-panics-doc || true''
];
-A clippy::missing-panics-doc
'';
meta.description = "Scan Nix files for dead code";
};
in