Skip to content

Commit

Permalink
Nix flake: add cargo-nightly for udeps
Browse files Browse the repository at this point in the history
  • Loading branch information
tesujimath committed Aug 22, 2024
1 parent 2594d29 commit e64c749
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,16 @@
pkgs = import nixpkgs {
inherit system overlays;
};
nu_plugin_bash_env = pkgs.writeShellScriptBin "nu_plugin_bash_env"
(builtins.replaceStrings [ "jq" "(cat)" " sed " ] [ "${pkgs.jq}/bin/jq" "(${pkgs.coreutils}/bin/cat)" " ${pkgs.gnused}/bin/sed " ]
(builtins.readFile ./nu_plugin_bash_env));
# cargo-nightly based on https://github.com/oxalica/rust-overlay/issues/82
nightly = pkgs.rust-bin.selectLatestNightlyWith (t: t.default);
cargo-nightly = pkgs.writeShellScriptBin "cargo-nightly" ''
export RUSTC="${nightly}/bin/rustc";
exec "${nightly}/bin/cargo" "$@"
'';
# TODO:
# nu_plugin_bash_env = pkgs.writeShellScriptBin "nu_plugin_bash_env"
# (builtins.replaceStrings [ "jq" "(cat)" " sed " ] [ "${pkgs.jq}/bin/jq" "(${pkgs.coreutils}/bin/cat)" " ${pkgs.gnused}/bin/sed " ]
# (builtins.readFile ./nu_plugin_bash_env));
in
with pkgs;
{
Expand All @@ -26,11 +33,13 @@
bashInteractive
jq
cargo-modules
cargo-nightly
cargo-udeps
rust-bin.stable.latest.default
];
};
packages.default = nu_plugin_bash_env;
# TODO: build package from Rust crate
# packages.default = nu_plugin_bash_env;
}
);
}

0 comments on commit e64c749

Please sign in to comment.