Skip to content

Instantly share code, notes, and snippets.

@Arkham
Last active September 20, 2021 18:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Arkham/c3d43136239d2aa963df792a45d14373 to your computer and use it in GitHub Desktop.
Save Arkham/c3d43136239d2aa963df792a45d14373 to your computer and use it in GitHub Desktop.
{ }:
let
sources = import nix/sources.nix { };
pkgs = import sources.nixpkgs { };
darwinInputs = with pkgs;
lib.optionals stdenv.isDarwin (with pkgs.darwin.apple_sdk.frameworks; [
AppKit
CoreFoundation
CoreServices
CoreVideo
Foundation
Metal
Security
]);
linuxInputs = with pkgs;
lib.optionals stdenv.isLinux [
glibc_multi
valgrind
vulkan-headers
vulkan-loader
vulkan-tools
vulkan-validation-layers
xorg.libX11
xorg.libXcursor
xorg.libXrandr
xorg.libXi
xorg.libxcb
];
llvmPkgs = pkgs.llvmPackages_12;
zig = import ./nix/zig.nix { inherit pkgs; };
debugir = import ./nix/debugir.nix { inherit pkgs; };
inputs = with pkgs; [
# build libraries
rustc
cargo
clippy
rustfmt
cmake
git
python3
llvmPkgs.llvm.dev
llvmPkgs.clang
libxkbcommon
pkg-config
zig
# lib deps
libffi
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
debugir
# 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
];
in pkgs.mkShell {
buildInputs = inputs ++ darwinInputs ++ linuxInputs;
# Additional Env vars
LLVM_SYS_120_PREFIX = "${llvmPkgs.llvm.dev}";
NIXOS_GLIBC_PATH =
if pkgs.stdenv.isLinux then "${pkgs.glibc_multi.out}/lib" else "";
LD_LIBRARY_PATH = with pkgs;
lib.makeLibraryPath
([ pkg-config stdenv.cc.cc.lib libffi ncurses zlib ] ++ linuxInputs);
}
{
"nixpkgs": {
"branch": "nixpkgs-unstable",
"description": "Nix Packages collection",
"homepage": "",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "1441fa74d213d7cc120d9d7d49e540c1fc59bc58",
"sha256": "152qb7ch0r4bidik33zd0a9wl0929zr0dqs5l5ksm7vh3assc7sc",
"type": "tarball",
"url": "https://github.com/NixOS/nixpkgs/archive/1441fa74d213d7cc120d9d7d49e540c1fc59bc58.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment