Skip to content

Commit

Permalink
nix: derive shell.nix from default.nix
Browse files Browse the repository at this point in the history
  • Loading branch information
rbonichon committed Oct 30, 2023
1 parent 3e634a7 commit 25ab9f3
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 22 deletions.
37 changes: 37 additions & 0 deletions default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{ pkgs ? import <nixpkgs> { } }:

let
# Mac OS specific dependencies
darwin_packages = (with pkgs;
[
curl
darwin.apple_sdk.frameworks.Security
darwin.apple_sdk.frameworks.CoreServices
libiconv
]);
buildInputs = with pkgs;
[
pkg-config
openssl
cargo
rustc
rustfmt
] ++ lib.optionals stdenv.isDarwin darwin_packages;
in
{
proof-systems =
pkgs.rustPlatform.buildRustPackage
{
pname = "proof-systems";
version = "1.0.0";
buildInputs = buildInputs;
cargoLock = {
lockFile = ./Cargo.lock;
};
src = pkgs.lib.cleanSource ./.;
};

devshell = pkgs.mkShell {
buildInputs = buildInputs;
};
}
23 changes: 1 addition & 22 deletions shell.nix
Original file line number Diff line number Diff line change
@@ -1,22 +1 @@
{ pkgs ? import <nixpkgs> { } }:

let
# Mac OS specific dependencies
darwin_packages = (with pkgs;
[
curl
darwin.apple_sdk.frameworks.Security
darwin.apple_sdk.frameworks.CoreServices
libiconv
]);
in
pkgs.mkShell {
buildInputs = with pkgs;
[
pkg-config
openssl
cargo
rustc
rustfmt
] ++ lib.optionals stdenv.isDarwin darwin_packages;
}
(import ./default.nix { }).devshell

0 comments on commit 25ab9f3

Please sign in to comment.