Skip to content

Commit

Permalink
refactor(nix): Manual autowiring, done uniformly
Browse files Browse the repository at this point in the history
Also removes the nix-health package.

Manual impl until juspay/rust-flake#23
  • Loading branch information
srid committed Sep 3, 2024
1 parent 4524a22 commit 3542267
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
1 change: 0 additions & 1 deletion crates/nix_health/crate.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ let
inherit (flake) inputs;
in
{
autoWire = true;
crane = {
args = {
buildInputs = lib.optionals pkgs.stdenv.isDarwin (
Expand Down
1 change: 0 additions & 1 deletion crates/nix_rs/crate.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ let
inherit (flake) inputs;
in
{
autoWire = true;
crane = {
args = {
buildInputs = lib.optionals pkgs.stdenv.isDarwin (
Expand Down
1 change: 0 additions & 1 deletion crates/nixci/crate.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ let
inherit (flake) inputs;
in
{
autoWire = true;
crane = {
args = {
nativeBuildInputs = with pkgs; with pkgs.apple_sdk_frameworks; lib.optionals stdenv.isDarwin [
Expand Down
13 changes: 11 additions & 2 deletions nix/modules/rust.nix
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,20 @@
in
{
# Clippy checks
# TODO: Remove after https://github.com/juspay/rust-flake/issues/23
omnix-cli-clippy = crates."omnix-cli".crane.outputs.drv.clippy;
nix_rs-clippy = crates."nix_rs".crane.outputs.drv.clippy;
nixci-clippy = crates."nixci".crane.outputs.drv.clippy;
nix_health-clippy = crates."nix_health".crane.outputs.drv.clippy;
};

packages =
let
inherit (config.rust-project) crates;
in
{
default = crates."omnix-cli".crane.outputs.drv.crate.overrideAttrs (oa: {
rec {
default = omnix-cli;
omnix-cli = crates."omnix-cli".crane.outputs.drv.crate.overrideAttrs (oa: {
nativeBuildInputs = (oa.nativeBuildInputs or [ ]) ++ [ pkgs.installShellFiles ];
postInstall = ''
installShellCompletion --cmd om \
Expand All @@ -41,7 +46,11 @@
});

# Rust docs
# TODO: Remove after https://github.com/juspay/rust-flake/issues/23
omnix-cli-doc = crates."omnix-cli".crane.outputs.drv.doc;
nix_rs-doc = crates."nix_rs".crane.outputs.drv.doc;
nixci-doc = crates."nixci".crane.outputs.drv.doc;
nix_health-doc = crates."nix_health".crane.outputs.drv.doc;

/*
gui = crates."omnix-gui".crane.outputs.drv.crate.overrideAttrs (oa: {
Expand Down

0 comments on commit 3542267

Please sign in to comment.