Skip to content

Commit

Permalink
chore: format
Browse files Browse the repository at this point in the history
  • Loading branch information
pk5ls20 committed Feb 21, 2025
1 parent aef91d0 commit 9d95b50
Showing 1 changed file with 10 additions and 41 deletions.
51 changes: 10 additions & 41 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,7 @@
system:
let
overlays = [ (import rust-overlay) ];
pkgs = import nixpkgs {
inherit system overlays;
};
pkgs = import nixpkgs { inherit system overlays; };
filteredSource =
let
pathsToIgnore = [
Expand Down Expand Up @@ -77,18 +75,8 @@
craneLib = (crane.mkLib pkgs).overrideToolchain rustToolchain;
commonArgs = {
inherit stdenv;
inherit
(craneLib.crateNameFromCargoToml {
cargoToml = ./mania/Cargo.toml;
})
pname
;
inherit
(craneLib.crateNameFromCargoToml {
cargoToml = ./Cargo.toml;
})
version
;
inherit (craneLib.crateNameFromCargoToml { cargoToml = ./mania/Cargo.toml; }) pname;
inherit (craneLib.crateNameFromCargoToml { cargoToml = ./Cargo.toml; }) version;
src = filteredSource;
strictDeps = true;
nativeBuildInputs = [
Expand All @@ -104,18 +92,16 @@
license = pkgs.lib.licenses.gpl3Only;
};
env = {
LIBCLANG_PATH = "${pkgs.libclang.lib}/lib";
BINDGEN_EXTRA_CLANG_ARGS = "-isystem ${pkgs.llvmPackages.libcxxClang}/lib/clang/${pkgs.lib.getVersion pkgs.clang}/include";
LIBCLANG_PATH = "${pkgs.libclang.lib}/lib";
BINDGEN_EXTRA_CLANG_ARGS = "-isystem ${pkgs.llvmPackages.libcxxClang}/lib/clang/${pkgs.lib.getVersion pkgs.clang}/include";
};
};
cargoArtifacts = craneLib.buildDepsOnly commonArgs;
typoCheck =
pkgs.runCommandNoCCLocal "check-typo"
{
src = ./.;
nativeBuildInputs = with pkgs; [
typos
];
nativeBuildInputs = with pkgs; [ typos ];
}
''
mkdir -p $out
Expand Down Expand Up @@ -190,12 +176,7 @@
checks = {
inherit (self.packages."${system}") mania;
typo = typoCheck;
audit = craneLib.cargoAudit (
commonArgs
// {
inherit advisory-db;
}
);
audit = craneLib.cargoAudit (commonArgs // { inherit advisory-db; });
clippy = craneLib.cargoClippy (
commonArgs
// {
Expand All @@ -204,18 +185,8 @@
}
);
fmt = fmtCheck;
doc = craneLib.cargoDoc (
commonArgs
// {
inherit cargoArtifacts;
}
);
test = craneLib.cargoTest (
commonArgs
// {
inherit cargoArtifacts;
}
);
doc = craneLib.cargoDoc (commonArgs // { inherit cargoArtifacts; });
test = craneLib.cargoTest (commonArgs // { inherit cargoArtifacts; });
};
devShells.default = pkgs.mkShell {
inputsFrom = builtins.attrValues self.checks."${system}";
Expand All @@ -236,8 +207,6 @@
}
)
// {
overlays.default = final: prev: {
inherit (self.packages."${final.system}") mania;
};
overlays.default = final: prev: { inherit (self.packages."${final.system}") mania; };
};
}

0 comments on commit 9d95b50

Please sign in to comment.