chore(*.nix): pin nixpkgs version, use clang/llvm 8, reorganize

This commit is contained in:
Sebastian Ullrich 2019-08-28 13:04:59 +02:00
parent 572926f5ce
commit dbdae550ea
4 changed files with 18 additions and 11 deletions

View file

@ -1,3 +1,3 @@
{ pkgs ? import <nixpkgs> {} }:
{ pkgs ? import ./nix/nixpkgs.nix, llvmPackages ? pkgs.llvmPackages_8 }:
pkgs.callPackage ./derivation.nix {}
pkgs.callPackage ./nix/derivation.nix { inherit llvmPackages; }

View file

@ -1,14 +1,14 @@
{ clangStdenv, cmake, llvm, python, gmp }:
{ llvmPackages, cmake, python, gmp }:
clangStdenv.mkDerivation rec {
llvmPackages.stdenv.mkDerivation rec {
name = "lean-${version}";
version = "local";
# I have way too many untracked files in my checkout
src = builtins.fetchGit { url = ./.; };
src = builtins.fetchGit { url = ../.; };
nativeBuildInputs = [ cmake python ];
buildInputs = [ gmp llvm ];
buildInputs = [ gmp llvmPackages.llvm ];
enableParallelBuilding = true;
preConfigure = ''
@ -18,7 +18,7 @@ clangStdenv.mkDerivation rec {
patchShebangs ../../bin
'';
meta = with clangStdenv.lib; {
meta = with llvmPackages.stdenv.lib; {
description = "Automatic and interactive theorem prover";
homepage = https://leanprover.github.io/;
license = licenses.asl20;

7
nix/nixpkgs.nix Normal file
View file

@ -0,0 +1,7 @@
import (builtins.fetchTarball {
name = "nixos-unstable-2019-08-28";
# Commit hash from `git ls-remote https://github.com/nixos/nixpkgs-channels nixos-unstable`
url = https://github.com/nixos/nixpkgs/archive/3f4144c30a6351dd79b177328ec4dea03e2ce45f.tar.gz;
# Hash obtained using `nix-prefetch-url --unpack <url>`
sha256 = "1qg5n60n3fr6cypihnrjw451fadps5pysj5p0vvfb320mpfvlbjb";
}) {}

View file

@ -1,11 +1,11 @@
{ pkgs ? import <nixpkgs> {}, clang ? pkgs.clang_7 }:
{ pkgs ? import ./nix/nixpkgs.nix }:
let
lean = pkgs.callPackage ./derivation.nix { llvm = clang.cc.llvm; };
lean = import ./default.nix { inherit pkgs; };
temci = pkgs.callPackage (builtins.fetchGit { url = https://github.com/parttimenerd/temci.git; rev = "2facd7c78ab35722f34db1d42883ec02f8a0de23"; }) {};
in pkgs.mkShell rec {
in pkgs.mkShell.override { stdenv = lean.stdenv; } rec {
inputsFrom = [ lean ];
buildInputs = with pkgs; [ temci clang ccache ninja ];
buildInputs = with pkgs; [ temci ccache ninja ];
# https://github.com/NixOS/nixpkgs/issues/60919
hardeningDisable = [ "all" ];
# TODO: this should not be necessary when leanc starts statically linking binaries