Something went wrong. Try again.
forked from crunchy-labs/crunchy-cli
Something went wrong. Try again.
crunchycli flake.nix
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677{ inputs = { nixpkgs.url = "flake:nixpkgs/nixpkgs-unstable"; utils.url = "flake:flake-utils"; };
outputs = { self, nixpkgs, utils }: utils.lib.eachDefaultSystem (system: let # enable musl on Linux will trigger a toolchain rebuild # making the build very slow pkgs = import nixpkgs { inherit system; }; # if nixpkgs.legacyPackages.${system}.stdenv.hostPlatform.isLinux # then nixpkgs.legacyPackages.${system}.pkgsMusl # else nixpkgs.legacyPackages.${system};
crunchy-cli = pkgs.rustPlatform.buildRustPackage.override { stdenv = pkgs.clangStdenv; } rec { pname = "crunchy-cli"; inherit ((pkgs.lib.importTOML ./Cargo.toml).package) version;
src = pkgs.lib.cleanSource ./.;
cargoLock = { lockFile = ./Cargo.lock; allowBuiltinFetchGit = true; };
buildNoDefaultFeatures = true; buildFeatures = [ "openssl-tls" ];
nativeBuildInputs = [ pkgs.pkg-config ] ++ pkgs.lib.optionals pkgs.stdenv.isDarwin [ pkgs.xcbuild ];
buildInputs = [ pkgs.openssl ] ++ pkgs.lib.optionals pkgs.stdenv.isDarwin [ pkgs.darwin.Security ]; }; in { packages.default = crunchy-cli;
devShells.default = pkgs.mkShell { packages = with pkgs; [ cargo clippy rust-analyzer rustc rustfmt ];
inputsFrom = builtins.attrValues self.packages.${system};
buildInputs = [ pkgs.openssl pkgs.libiconv ] ++ pkgs.lib.optionals pkgs.stdenv.isDarwin [ pkgs.darwin.apple_sdk.frameworks.CoreServices pkgs.darwin.Security ];
RUST_SRC_PATH = pkgs.rustPlatform.rustLibSrc; };
formatter = pkgs.nixpkgs-fmt; } ) // { overlays.default = final: prev: { inherit (self.packages.${final.system}) crunchy-cli; }; };}