roc/nix/default.nix
2024-04-22 21:25:46 -05:00

28 lines
949 B
Nix

{ pkgs }:
let
rustVersion = (pkgs.rust-bin.fromRustupToolchainFile ../rust-toolchain.toml);
rustPlatform = pkgs.makeRustPlatform {
cargo = rustVersion;
rustc = rustVersion;
};
# this will allow our callPackage to reference our own packages defined below
# mainly helps with passing compile-deps and rustPlatform to builder automatically
callPackage = pkgs.lib.callPackageWith (pkgs // packages);
packages = {
inherit rustPlatform;
compile-deps = callPackage ./compile-deps.nix { };
rust-shell =
(rustVersion.override { extensions = [ "rust-src" "rust-analyzer" ]; });
# all rust crates in workspace.members of Cargo.toml
roc-full = callPackage ./builder.nix { };
roc-lang-server = callPackage ./builder.nix { subPackage = "language_server"; };
# only the CLI crate = executable provided in nightly releases
roc-cli = callPackage ./builder.nix { subPackage = "cli"; };
};
in
packages