From 463656a9a1db25dca97847f5961aab27a3403105 Mon Sep 17 00:00:00 2001 From: asonix Date: Thu, 9 Mar 2023 20:19:40 -0600 Subject: [PATCH] Add shell.nix --- flake.nix | 15 +++++++++++++-- shell.nix | 16 ++++++++++++++++ 2 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 shell.nix diff --git a/flake.nix b/flake.nix index eefdbf6..d79fc5a 100644 --- a/flake.nix +++ b/flake.nix @@ -14,8 +14,19 @@ }; in { - defaultPackage = pkgs.callPackage ./pict-rs.nix { - inherit (pkgs.darwin.apple_sdk.frameworks) Security; + packages = rec { + pict-rs = pkgs.callPackage ./pict-rs.nix { + inherit (pkgs.darwin.apple_sdk.frameworks) Security; + }; + + default = pict-rs; }; + + apps = rec { + dev = flake-utils.lib.mkApp { drv = self.packages.${system}.pict-rs; }; + default = dev; + }; + + devShell = pkgs.callPackage ./shell.nix { }; }); } diff --git a/shell.nix b/shell.nix new file mode 100644 index 0000000..df89250 --- /dev/null +++ b/shell.nix @@ -0,0 +1,16 @@ +{ pkgs +, mkShell +, cargo +, clippy +, gcc +, protobuf +, rust-analyzer +, rustc +, rustfmt +}: + +mkShell { + nativeBuildInputs = [ cargo clippy gcc protobuf rust-analyzer rustc rustfmt ]; + + RUST_SRC_PATH = "${pkgs.rust.packages.stable.rustPlatform.rustLibSrc}"; +}