I had to compare a bunch of online examples and copy paste stuff here and there to get dioxus-cli to compile:
# flake.nix
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
rust-overlay.url = "github:oxalica/rust-overlay";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = {
self,
nixpkgs,
rust-overlay,
flake-utils, ...
}: flake-utils.lib.eachDefaultSystem (system:
let
overlays = [ (import rust-overlay)];
pkgs = import nixpkgs {
inherit system overlays;
};
toolchain = pkgs.rust-bin.fromRustupToolchainFile ./toolchain.toml;
in
{
devShells.default = pkgs.mkShell {
packages = [
pkgs.darwin.apple_sdk.frameworks.Security
pkgs.darwin.apple_sdk.frameworks.CoreServices
pkgs.zlib
toolchain
];
};
}
);
}
Toolchain contains:
[toolchain]
channel = "nightly"
profile = "default"
targets = ["wasm32-unknown-unknown", "aarch64-apple-darwin"]
That was a relatively bad experience and it set back my development here back by at least 30-45 minutes.
Then I found out that the cli is in nixpkgs, so for that I needn’t have bothered (but might need the same dependencies for developing anyway?).