From a6a575d4dadbc1837c0dc7f9a67a843bc97e8789 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Sat, 26 Oct 2024 09:16:40 -0400 Subject: [PATCH] nix: Build clippy/doc outside of Nix In devShell. --- crates/nix_rs/crate.nix | 4 +--- crates/omnix-ci/crate.nix | 4 +--- crates/omnix-cli/crate.nix | 4 +--- crates/omnix-common/crate.nix | 4 +--- crates/omnix-develop/crate.nix | 4 +--- crates/omnix-health/crate.nix | 4 +--- crates/omnix-init/crate.nix | 4 +--- justfile | 5 +++++ nix/modules/flake-parts/om.nix | 13 +++++++++++-- 9 files changed, 23 insertions(+), 23 deletions(-) diff --git a/crates/nix_rs/crate.nix b/crates/nix_rs/crate.nix index 0119716e..298d8ebb 100644 --- a/crates/nix_rs/crate.nix +++ b/crates/nix_rs/crate.nix @@ -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; [ diff --git a/crates/omnix-ci/crate.nix b/crates/omnix-ci/crate.nix index c9e501e3..a6669a63 100644 --- a/crates/omnix-ci/crate.nix +++ b/crates/omnix-ci/crate.nix @@ -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 [ diff --git a/crates/omnix-cli/crate.nix b/crates/omnix-cli/crate.nix index 39c69f4a..66dad486 100644 --- a/crates/omnix-cli/crate.nix +++ b/crates/omnix-cli/crate.nix @@ -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 [ diff --git a/crates/omnix-common/crate.nix b/crates/omnix-common/crate.nix index 83cf82bd..75080041 100644 --- a/crates/omnix-common/crate.nix +++ b/crates/omnix-common/crate.nix @@ -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) diff --git a/crates/omnix-develop/crate.nix b/crates/omnix-develop/crate.nix index 767d9869..6feb2f11 100644 --- a/crates/omnix-develop/crate.nix +++ b/crates/omnix-develop/crate.nix @@ -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; [ diff --git a/crates/omnix-health/crate.nix b/crates/omnix-health/crate.nix index 836049ea..4c1b6d88 100644 --- a/crates/omnix-health/crate.nix +++ b/crates/omnix-health/crate.nix @@ -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 ( diff --git a/crates/omnix-init/crate.nix b/crates/omnix-init/crate.nix index 2c142dd7..c4939fbf 100644 --- a/crates/omnix-init/crate.nix +++ b/crates/omnix-init/crate.nix @@ -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; [ diff --git a/justfile b/justfile index 3a08f432..60d8f3cc 100644 --- a/justfile +++ b/justfile @@ -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 diff --git a/nix/modules/flake-parts/om.nix b/nix/modules/flake-parts/om.nix index ee4d0130..edbb9c8b 100644 --- a/nix/modules/flake-parts/om.nix +++ b/nix/modules/flake-parts/om.nix @@ -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 }; }; };