2021-07-20 16:23:29 +03:00
|
|
|
{ }:
|
2020-10-24 22:22:51 +03:00
|
|
|
|
2020-11-24 09:00:16 +03:00
|
|
|
let
|
2021-07-20 16:20:27 +03:00
|
|
|
sources = import nix/sources.nix { };
|
|
|
|
pkgs = import sources.nixpkgs { };
|
2020-11-11 20:55:00 +03:00
|
|
|
|
2021-07-20 16:23:29 +03:00
|
|
|
darwinInputs = with pkgs;
|
|
|
|
lib.optionals stdenv.isDarwin (with pkgs.darwin.apple_sdk.frameworks; [
|
|
|
|
AppKit
|
|
|
|
CoreFoundation
|
|
|
|
CoreServices
|
|
|
|
CoreVideo
|
|
|
|
Foundation
|
|
|
|
Metal
|
|
|
|
Security
|
|
|
|
]);
|
2020-11-11 20:55:00 +03:00
|
|
|
|
2021-07-20 16:23:29 +03:00
|
|
|
linuxInputs = with pkgs;
|
2021-06-01 01:40:26 +03:00
|
|
|
lib.optionals stdenv.isLinux [
|
|
|
|
valgrind
|
|
|
|
vulkan-headers
|
|
|
|
vulkan-loader
|
|
|
|
vulkan-tools
|
|
|
|
vulkan-validation-layers
|
|
|
|
xorg.libX11
|
|
|
|
xorg.libXcursor
|
|
|
|
xorg.libXrandr
|
|
|
|
xorg.libXi
|
|
|
|
xorg.libxcb
|
|
|
|
];
|
2020-11-11 20:55:00 +03:00
|
|
|
|
2021-06-08 03:33:57 +03:00
|
|
|
llvmPkgs = pkgs.llvmPackages_12;
|
2020-10-29 04:22:54 +03:00
|
|
|
|
2021-06-01 02:02:39 +03:00
|
|
|
zig = import ./nix/zig.nix { inherit pkgs; };
|
2021-08-09 04:56:32 +03:00
|
|
|
debugir = import ./nix/debugir.nix { inherit pkgs; };
|
2021-06-01 01:40:26 +03:00
|
|
|
|
2021-07-20 16:23:29 +03:00
|
|
|
inputs = with pkgs; [
|
2021-06-01 01:40:26 +03:00
|
|
|
# build libraries
|
|
|
|
rustc
|
|
|
|
cargo
|
|
|
|
clippy
|
|
|
|
rustfmt
|
|
|
|
cmake
|
|
|
|
git
|
|
|
|
python3
|
2021-06-16 05:09:21 +03:00
|
|
|
llvmPkgs.llvm.dev
|
2021-06-01 01:40:26 +03:00
|
|
|
llvmPkgs.clang
|
|
|
|
pkg-config
|
|
|
|
zig
|
2020-11-10 20:22:11 +03:00
|
|
|
|
2021-06-01 01:40:26 +03:00
|
|
|
# lib deps
|
2021-08-07 18:26:30 +03:00
|
|
|
glibc_multi
|
2021-06-01 01:40:26 +03:00
|
|
|
llvmPkgs.libcxx
|
|
|
|
llvmPkgs.libcxxabi
|
|
|
|
libffi
|
|
|
|
libunwind
|
|
|
|
libxml2
|
|
|
|
ncurses
|
|
|
|
zlib
|
|
|
|
libiconv
|
|
|
|
|
|
|
|
# faster builds - see https://github.com/rtfeldman/roc/blob/trunk/BUILDING_FROM_SOURCE.md#use-lld-for-the-linker
|
|
|
|
llvmPkgs.lld
|
2021-08-09 04:56:32 +03:00
|
|
|
debugir
|
2021-07-20 16:36:00 +03:00
|
|
|
|
|
|
|
# meta-tools
|
|
|
|
# note: niv manages its own nixpkgs so it doesn't need pkgs.callPackage. Do
|
|
|
|
# `cachix use niv` to get cached builds!
|
|
|
|
(import sources.niv { }).niv
|
2021-06-01 01:40:26 +03:00
|
|
|
];
|
2021-07-20 16:23:29 +03:00
|
|
|
in pkgs.mkShell {
|
|
|
|
buildInputs = inputs ++ darwinInputs ++ linuxInputs;
|
2020-09-05 23:58:33 +03:00
|
|
|
|
2021-07-20 16:23:29 +03:00
|
|
|
# Additional Env vars
|
|
|
|
LLVM_SYS_120_PREFIX = "${llvmPkgs.llvm.dev}";
|
2021-08-08 01:31:31 +03:00
|
|
|
NIXOS_GLIBC_PATH = "${pkgs.glibc_multi.out}/lib";
|
2021-07-20 16:23:29 +03:00
|
|
|
LD_LIBRARY_PATH = with pkgs;
|
|
|
|
lib.makeLibraryPath ([
|
|
|
|
pkg-config
|
|
|
|
stdenv.cc.cc.lib
|
|
|
|
llvmPkgs.libcxx
|
|
|
|
llvmPkgs.libcxxabi
|
|
|
|
libunwind
|
|
|
|
libffi
|
|
|
|
ncurses
|
|
|
|
zlib
|
|
|
|
] ++ linuxInputs);
|
|
|
|
}
|