Skip to content

Commit

Permalink
nix: Build clippy/doc outside of Nix
Browse files Browse the repository at this point in the history
In devShell.
  • Loading branch information
srid committed Oct 26, 2024
1 parent 3bfbcc0 commit a6a575d
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 23 deletions.
4 changes: 1 addition & 3 deletions crates/nix_rs/crate.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ let
inherit (flake) inputs;
in
{
autoWire = lib.optionals
(lib.elem pkgs.system [ "x86_64-linux" "aarch64-darwin" ])
[ "doc" "clippy" ];
autoWire = [ ];
crane = {
args = {
nativeBuildInputs = with pkgs; [
Expand Down
4 changes: 1 addition & 3 deletions crates/omnix-ci/crate.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@ let
inherit (inputs) self;
in
{
autoWire = lib.optionals
(lib.elem pkgs.system [ "x86_64-linux" "aarch64-darwin" ])
[ "doc" "clippy" ];
autoWire = [ ];
crane = {
args = {
nativeBuildInputs = with pkgs; with pkgs.apple_sdk_frameworks; lib.optionals stdenv.isDarwin [
Expand Down
4 changes: 1 addition & 3 deletions crates/omnix-cli/crate.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@ let
inherit (pkgs) stdenv pkgsStatic;
in
{
autoWire = lib.optionals
(lib.elem pkgs.system [ "x86_64-linux" "aarch64-darwin" ])
[ "doc" "clippy" ];
autoWire = [ ];
crane = {
args = {
nativeBuildInputs = with pkgs.apple_sdk_frameworks; lib.optionals stdenv.isDarwin [
Expand Down
4 changes: 1 addition & 3 deletions crates/omnix-common/crate.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@
}:

{
autoWire = lib.optionals
(lib.elem pkgs.system [ "x86_64-linux" "aarch64-darwin" ])
[ "doc" "clippy" ];
autoWire = [ ];
crane = {
args = {
inherit (rust-project.crates."nix_rs".crane.args)
Expand Down
4 changes: 1 addition & 3 deletions crates/omnix-develop/crate.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@
}:

{
autoWire = lib.optionals
(lib.elem pkgs.system [ "x86_64-linux" "aarch64-darwin" ])
[ "doc" "clippy" ];
autoWire = [ ];
crane.args = {
buildInputs = lib.optionals pkgs.stdenv.isDarwin (
with pkgs.apple_sdk_frameworks; [
Expand Down
4 changes: 1 addition & 3 deletions crates/omnix-health/crate.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ let
inherit (flake) inputs;
in
{
autoWire = lib.optionals
(lib.elem pkgs.system [ "x86_64-linux" "aarch64-darwin" ])
[ "doc" "clippy" ];
autoWire = [ ];
crane = {
args = {
buildInputs = lib.optionals pkgs.stdenv.isDarwin (
Expand Down
4 changes: 1 addition & 3 deletions crates/omnix-init/crate.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@
}:

{
autoWire = lib.optionals
(lib.elem pkgs.system [ "x86_64-linux" "aarch64-darwin" ])
[ "doc" "clippy" ];
autoWire = [ ];
crane.args = {
buildInputs = lib.optionals pkgs.stdenv.isDarwin (
with pkgs.apple_sdk_frameworks; [
Expand Down
5 changes: 5 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,10 @@ ci:
ci-cargo:
cargo run -p omnix-cli -- ci run

[group('ci')]
clippy:
cargo clippy --release --locked --all-targets --all-features -- --deny warnings

[group('ci')]
cargo-doc:
cargo doc --release --all-features --workspace
13 changes: 11 additions & 2 deletions nix/modules/flake-parts/om.nix
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,18 @@
};
cargo-tests = {
type = "devshell";
# name = "default";
command = [ "cargo" "test" ];
systems = [ "x86_64-linux" "aarch64-darwin" ]; # Too slow on rosetta
systems = [ "x86_64-linux" "aarch64-darwin" ]; # Avoid emulated systems
};
cargo-clippy = {
type = "devshell";
command = [ "just" "clippy" ];
systems = [ "x86_64-linux" "aarch64-darwin" ]; # Avoid emulated systems
};
cargo-doc = {
type = "devshell";
command = [ "just" "cargo-doc" ];
systems = [ "x86_64-linux" "aarch64-darwin" ]; # Avoid emulated systems
};
};
};
Expand Down

0 comments on commit a6a575d

Please sign in to comment.