Jay Butera 4 lat temu
rodzic
commit
c20cb55616
1 zmienionych plików z 55 dodań i 0 usunięć
  1. 55 0
      flake.nix

+ 55 - 0
flake.nix

@@ -0,0 +1,55 @@
+{
+  description = "Darkfi Dev Environment";
+
+  inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-21.11";
+  inputs.flake-utils.url = "github:numtide/flake-utils";
+  inputs.mozilla = { url = "github:mozilla/nixpkgs-mozilla"; flake = false; };
+
+  outputs =
+    { self
+    , nixpkgs
+    , mozilla
+    , flake-utils
+    , ...
+    } @inputs:
+    let rustOverlay = final: prev:
+          let rustChannel = prev.rustChannelOf {
+            channel = "1.58.0";
+            sha256 = "sha256-eQBpSmy9+oHfVyPs0Ea+GVZ0fvIatj6QVhNhYKOJ6Jk=";
+          };
+          in
+          { inherit rustChannel;
+            rustc = rustChannel.rust;
+            cargo = rustChannel.rust;
+          };
+    in flake-utils.lib.eachDefaultSystem
+      (system:
+        let
+        pkgs = import nixpkgs {
+          inherit system;
+          overlays = [
+            (import "${mozilla}/rust-overlay.nix")
+            rustOverlay
+          ];
+        };
+        in {
+          devShell = pkgs.mkShell {
+            #RUST_BACKTRACE=1;
+            #RUST_LOG="trace";
+            buildInputs = with pkgs; [
+              openssl
+              gnumake
+              openssl
+              clang
+              libclang
+              pkg-config
+              cmake
+              llvm
+              freetype
+              fontconfig
+              (rustChannel.rust.override { extensions = [ "rust-src" ]; })
+            ];
+            LIBCLANG_PATH="${pkgs.libclang.lib}/lib";
+          };
+        });
+}