diff --git a/.github/workflows/nix.yml b/.github/workflows/nix.yml index d3f17fb..83bff84 100644 --- a/.github/workflows/nix.yml +++ b/.github/workflows/nix.yml @@ -2,18 +2,25 @@ name: "Nix" on: pull_request: push: + workflow_dispatch: jobs: test: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 - - uses: cachix/install-nix-action@v6 - - uses: cachix/cachix-action@v3 + - uses: actions/checkout@v2.3.4 + - uses: cachix/install-nix-action@v13 + with: + install_url: https://github.com/numtide/nix-unstable-installer/releases/download/nix-2.5pre20211015_130284b/install + extra_nix_config: | + experimental-features = nix-command flakes + - uses: cachix/cachix-action@v10 with: name: xe - run: | - rm result - nix-build docker.nix - docker load -i result + nix build .#docker --impure + # the shell expansion will identify the build, and, because we know + # we're guaranteed to only have one file in result/docker due to the + # pure flake, will always properly expand to just the one target image. + docker load -i result/docker/* docker run --rm xena/pahi:latest /bin/testrunner docker run --rm -w /wasm xena/pahi:latest /tests/bench.sh diff --git a/default.nix b/default.nix deleted file mode 100644 index 055efd0..0000000 --- a/default.nix +++ /dev/null @@ -1,63 +0,0 @@ -{ sources ? import ./nix/sources.nix }: -let - rust = import ./nix/rust.nix { inherit sources; }; - pkgs = import sources.nixpkgs { }; - dhall = import ./nix/dhall.nix { inherit sources pkgs; }; - olin-cwa = import sources.olin { }; - naersk = pkgs.callPackage sources.naersk { - rustc = rust; - cargo = rust; - }; - name = "pahi"; - src = builtins.filterSource - (path: type: type != "directory" || builtins.baseNameOf path != "target") - ./.; - - pahi = naersk.buildPackage { - inherit name src; - buildInputs = [ pkgs.openssl pkgs.pkg-config ]; - }; - - olin = naersk.buildPackage { - name = "olin"; - src = ./wasm; - - buildInputs = [ olin-cwa ]; - doCheck = false; - }; - - olin-spec = import ./olin-spec { inherit pkgs sources; }; - docs = import ./docs { inherit pkgs sources; }; - pahi-testrunner = import ./tests { inherit pkgs sources; }; - - composite = pkgs.stdenv.mkDerivation { - version = "latest"; - phases = "installPhase"; - inherit name src; - - installPhase = '' - mkdir -p $out/docs/olin-spec - cp -rf ${docs}/docs $out - cp -rf ${olin-spec}/docs $out - mkdir -p $out/bin - cp -rf ${olin-cwa}/bin/cwa $out/bin - cp -rf ${pahi}/bin/pahi $out/bin - mkdir -p $out/wasm - - for f in ${olin}/bin/* - do - cp "$f" "$out/wasm/$(basename $f)".wasm - done - - cp -rf ${olin-cwa}/wasm/zig $out/wasm/zig - - cp -rf ${pahi-testrunner}/bin/tests $out/bin/testrunner - mkdir -p $out/tests - cp -rf ${pahi-testrunner}/tests/testdata.dhall $out/tests/testdata.dhall - cp -rf ${pahi-testrunner}/tests/bench.sh $out/tests/bench.sh - - cp $src/README.md $out/README.md - cp $src/LICENSE $out/LICENSE - ''; - }; -in composite diff --git a/docker.nix b/docker.nix deleted file mode 100644 index 847c865..0000000 --- a/docker.nix +++ /dev/null @@ -1,31 +0,0 @@ -{ system ? builtins.currentSystem }: - -let - sources = import ./nix/sources.nix; - pkgs = import sources.nixpkgs { }; - dhall = import ./nix/dhall.nix; - callPackage = pkgs.lib.callPackageWith pkgs; - pahi = callPackage ./default.nix { }; - - dockerImage = pkg: - pkgs.dockerTools.buildLayeredImage { - name = "xena/pahi"; - tag = "latest"; - - contents = [ - pkg - pkgs.bash - pkgs.cacert - pkgs.coreutils - pkgs.hyperfine - dhall.dhall-json-simple - ]; - - config = { - Cmd = [ "/bin/bash" ]; - WorkingDir = "/"; - Env = [ "NIX_SSL_CERT_FILE=/etc/ssl/certs/ca-bundle.crt" ]; - }; - }; - -in dockerImage pahi diff --git a/docs/default.nix b/docs/default.nix index 5445160..136eaf8 100644 --- a/docs/default.nix +++ b/docs/default.nix @@ -1,4 +1,4 @@ -{ sources ? import ../nix/sources.nix, pkgs ? import sources.nixpkgs { }}: +{ pkgs }: let src = builtins.filterSource (path: type: type != "directory" || builtins.baseNameOf path != "olin-spec") diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..292b153 --- /dev/null +++ b/flake.lock @@ -0,0 +1,115 @@ +{ + "nodes": { + "dhall-lang": { + "flake": false, + "locked": { + "narHash": "sha256-4CHI3du+DpCeU6vdsirhyuvJXt/9Rl89EkdB//SKHKM=", + "type": "tarball", + "url": "https://github.com/dhall-lang/dhall-lang/archive/ccb9f5d54b0ecba05a6493e84442ce445e411e9e.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://github.com/dhall-lang/dhall-lang/archive/ccb9f5d54b0ecba05a6493e84442ce445e411e9e.tar.gz" + } + }, + "easy-dhall-nix": { + "flake": false, + "locked": { + "narHash": "sha256-r6cU2A2yqRzNkp000TdR5bTCIQGLvfOxiGh5uHjwGQ8=", + "type": "tarball", + "url": "https://github.com/justinwoo/easy-dhall-nix/archive/7c22a145fcb8e00b61d29efc7543af0c80d709ed.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://github.com/justinwoo/easy-dhall-nix/archive/7c22a145fcb8e00b61d29efc7543af0c80d709ed.tar.gz" + } + }, + "naersk": { + "inputs": { + "nixpkgs": "nixpkgs" + }, + "locked": { + "lastModified": 1632266297, + "narHash": "sha256-J1yeJk6Gud9ef2pEf6aKQemrfg1pVngYDSh+SAY94xk=", + "owner": "nix-community", + "repo": "naersk", + "rev": "ee7edec50b49ab6d69b06d62f1de554efccb1ccd", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "naersk", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1634073448, + "narHash": "sha256-e0z1FxOf6BrPUmzgUKlCLf+jA9aHAOT0pLFctHQveGo=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "5b5d681a0724cc351e84950e6ec92b22134c0e1a", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "type": "indirect" + } + }, + "nixpkgs-mozilla": { + "flake": false, + "locked": { + "lastModified": 1629225446, + "narHash": "sha256-HJX4Pc5ZUAg4apxB/XHuJ+6ukzvRQqeZMjscOBst2bA=", + "owner": "mozilla", + "repo": "nixpkgs-mozilla", + "rev": "0510159186dd2ef46e5464484fbdf119393afa58", + "type": "github" + }, + "original": { + "owner": "mozilla", + "repo": "nixpkgs-mozilla", + "type": "github" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1634073448, + "narHash": "sha256-e0z1FxOf6BrPUmzgUKlCLf+jA9aHAOT0pLFctHQveGo=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "5b5d681a0724cc351e84950e6ec92b22134c0e1a", + "type": "github" + }, + "original": { + "owner": "NixOS", + "repo": "nixpkgs", + "type": "github" + } + }, + "olin": { + "flake": false, + "locked": { + "narHash": "sha256-r8valcDgcyd9LiiW5I0spUTf4TbTycya2W1eQgjt0ZE=", + "type": "tarball", + "url": "https://github.com/Xe/olin/archive/0e8c8eea725307f8f396919cbf7f965a0d67b0e0.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://github.com/Xe/olin/archive/0e8c8eea725307f8f396919cbf7f965a0d67b0e0.tar.gz" + } + }, + "root": { + "inputs": { + "dhall-lang": "dhall-lang", + "easy-dhall-nix": "easy-dhall-nix", + "naersk": "naersk", + "nixpkgs": "nixpkgs_2", + "nixpkgs-mozilla": "nixpkgs-mozilla", + "olin": "olin" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..c62d559 --- /dev/null +++ b/flake.nix @@ -0,0 +1,153 @@ +{ + description = "The next-generation Olin runtime, made with love"; + + inputs.dhall-lang.url = "https://github.com/dhall-lang/dhall-lang/archive/ccb9f5d54b0ecba05a6493e84442ce445e411e9e.tar.gz"; + inputs.dhall-lang.flake = false; + + inputs.easy-dhall-nix.url = "https://github.com/justinwoo/easy-dhall-nix/archive/7c22a145fcb8e00b61d29efc7543af0c80d709ed.tar.gz"; + inputs.easy-dhall-nix.flake = false; + + inputs.naersk.url = "github:nix-community/naersk"; + inputs.nixpkgs.url = "github:NixOS/nixpkgs"; + + inputs.nixpkgs-mozilla.url = "github:mozilla/nixpkgs-mozilla"; + inputs.nixpkgs-mozilla.flake = false; + + inputs.olin.url = "https://github.com/Xe/olin/archive/0e8c8eea725307f8f396919cbf7f965a0d67b0e0.tar.gz"; + inputs.olin.flake = false; + + outputs = { self, dhall-lang, easy-dhall-nix, naersk, nixpkgs, nixpkgs-mozilla, olin }: + let + pkgs = import nixpkgs { system = "x86_64-linux"; }; + naersk-lib = naersk.lib."x86_64-linux".override { rustc = rust; }; + + mozilla = pkgs.callPackage (nixpkgs-mozilla + "/package-set.nix") {}; + rust = let + channel = "nightly"; + date = "2020-07-27"; + targets = [ "wasm32-unknown-unknown" "wasm32-wasi" ]; + in (mozilla.rustChannelOf { + inherit channel date; + sha256 = "sha256-75eK1CNDEkeVvJ1phWOHZBuujMhalYCxbi5sgAFUlvI="; + }).rust.override { inherit targets; }; + + dhall = import easy-dhall-nix { inherit pkgs; }; + dhall-lang-pkg = import dhall-lang { inherit pkgs; }; + olin-cwa = import olin { inherit pkgs; }; + + olin-spec = import ./olin-spec { + inherit dhall-lang pkgs; + dhall = import easy-dhall-nix { inherit pkgs; }; + }; + + docs = import ./docs { inherit pkgs; }; + pahi-testrunner = import ./tests { inherit pkgs; }; + + olin-pkg = naersk-lib.buildPackage { + name = "olin"; + src = ./wasm; + + buildInputs = [ olin-cwa ]; + doCheck = false; + }; + + pahi = naersk-lib.buildPackage { + inherit name src; + buildInputs = [ pkgs.openssl pkgs.pkg-config ]; + }; + + name = "pahi"; + src = builtins.filterSource + (path: type: type != "directory" || builtins.baseNameOf path != "target") + ./.; + + in { + defaultPackage.x86_64-linux = pkgs.stdenv.mkDerivation { + version = "latest"; + phases = "buildPhase installPhase"; + inherit name src; + + installPhase = '' + mkdir -p $out/docs/olin-spec + cp -rf ${docs}/docs $out + cp -rf ${olin-spec}/docs $out + mkdir -p $out/bin + cp -rf ${olin-cwa}/bin/cwa $out/bin + cp -rf ${pahi}/bin/pahi $out/bin + mkdir -p $out/wasm + + for f in ${olin-pkg}/bin/* + do +<<<<<<< HEAD + cp "$f" "$out/wasm/$(basename $f)" +======= + cp "$f" "$out/wasm/$(basename $f)".wasm +>>>>>>> main + done + + cp -rf ${olin-cwa}/wasm/zig $out/wasm/zig + + cp -rf ${pahi-testrunner}/bin/tests $out/bin/testrunner + mkdir -p $out/tests + cp -rf ${pahi-testrunner}/tests/testdata.dhall $out/tests/testdata.dhall + cp -rf ${pahi-testrunner}/tests/bench.sh $out/tests/bench.sh + + cp $src/README.md $out/README.md + cp $src/LICENSE $out/LICENSE + ''; + }; + +<<<<<<< HEAD +======= + devShell.x86_64-linux = pkgs.mkShell { + buildInputs = [ + rust + + pkgs.hyperfine + + pkgs.openssl + pkgs.pkg-config + + dhall-lang-pkg + dhall + + pkgs.go + olin + ]; + }; + +>>>>>>> main + packages.x86_64-linux.docker = let + img = pkgs.dockerTools.buildLayeredImage { + name = "xena/pahi"; + tag = "latest"; + + contents = [ self.defaultPackage.x86_64-linux # pahi + pkgs.bash pkgs.coreutils pkgs.cacert pkgs.hyperfine +<<<<<<< HEAD + dhall.dhall-json-simple dhall-lang ]; +======= + dhall.dhall-json-simple ]; +>>>>>>> main + + config = { + Cmd = [ "/bin/bash" ]; + WorkingDir = "/"; + Env = [ "NIX_SSL_CERT_FILE=/etc/ssl/certs/ca-bundle.crt" ]; + }; + }; + in pkgs.stdenv.mkDerivation { + name = "pahi-docker"; + version = "latest"; + src = ./.; # this is a bit of a lie, but it works + + installPhase = '' + mkdir -p $out/docker/ + cp ${img} $out/docker/ + ''; + + doConfigure = false; + doBuild = false; + }; + }; +} diff --git a/nix/dhall.nix b/nix/dhall.nix deleted file mode 100644 index 2e12e25..0000000 --- a/nix/dhall.nix +++ /dev/null @@ -1,5 +0,0 @@ -let - sources = import ./sources.nix; - pkgs = import sources.nixpkgs { }; - dhall = import sources.easy-dhall-nix { inherit pkgs; }; -in dhall diff --git a/nix/rust.nix b/nix/rust.nix deleted file mode 100644 index 3b7f8ad..0000000 --- a/nix/rust.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ sources ? import ./sources.nix }: - -let - pkgs = - import sources.nixpkgs { overlays = [ (import sources.nixpkgs-mozilla) ]; }; - channel = "nightly"; - date = "2020-07-27"; - targets = [ "wasm32-unknown-unknown" "wasm32-wasi" ]; -in pkgs.rustChannelOfTargets channel date targets diff --git a/nix/sources.json b/nix/sources.json deleted file mode 100644 index cb81160..0000000 --- a/nix/sources.json +++ /dev/null @@ -1,86 +0,0 @@ -{ - "dhall-lang": { - "branch": "master", - "description": "Maintainable configuration files", - "homepage": "https://dhall-lang.org", - "owner": "dhall-lang", - "repo": "dhall-lang", - "rev": "ccb9f5d54b0ecba05a6493e84442ce445e411e9e", - "sha256": "18qwibsgyha728ymyipxvxgcksyaw4mb5pdbafg903myvgfwh8g0", - "type": "tarball", - "url": "https://github.com/dhall-lang/dhall-lang/archive/ccb9f5d54b0ecba05a6493e84442ce445e411e9e.tar.gz", - "url_template": "https://github.com///archive/.tar.gz" - }, - "easy-dhall-nix": { - "branch": "master", - "description": "Derivations for easily downloading Dhall binaries and putting them to use.", - "homepage": "", - "owner": "justinwoo", - "repo": "easy-dhall-nix", - "rev": "7c22a145fcb8e00b61d29efc7543af0c80d709ed", - "sha256": "03qry1wbhyb8i2qz7gcb04hw5d75a4vx2d4xjb6iradj1pc199xg", - "type": "tarball", - "url": "https://github.com/justinwoo/easy-dhall-nix/archive/7c22a145fcb8e00b61d29efc7543af0c80d709ed.tar.gz", - "url_template": "https://github.com///archive/.tar.gz" - }, - "naersk": { - "branch": "master", - "description": "Build rust crates in Nix. No configuration, no code generation. IFD and sandbox friendly.", - "homepage": "", - "owner": "nmattia", - "repo": "naersk", - "rev": "dcee40445cfe301ced2d1b11290d6a94ff3aadb9", - "sha256": "0n9d1zirrhi9cr31kbxifrxkk52grbny04xnn1qhmvskyc11pcm4", - "type": "tarball", - "url": "https://github.com/nmattia/naersk/archive/dcee40445cfe301ced2d1b11290d6a94ff3aadb9.tar.gz", - "url_template": "https://github.com///archive/.tar.gz" - }, - "niv": { - "branch": "master", - "description": "Easy dependency management for Nix projects", - "homepage": "https://github.com/nmattia/niv", - "owner": "nmattia", - "repo": "niv", - "rev": "ab9cc41caf44d1f1d465d8028e4bc0096fd73238", - "sha256": "17k52n8zwp832cqifsc4458mhy4044wmk22f807171hf6p7l4xvr", - "type": "tarball", - "url": "https://github.com/nmattia/niv/archive/ab9cc41caf44d1f1d465d8028e4bc0096fd73238.tar.gz", - "url_template": "https://github.com///archive/.tar.gz" - }, - "nixpkgs": { - "branch": "nixpkgs-unstable", - "description": "A read-only mirror of NixOS/nixpkgs tracking the released channels. Send issues and PRs to", - "homepage": "https://github.com/NixOS/nixpkgs", - "owner": "NixOS", - "repo": "nixpkgs-channels", - "rev": "5ad1cdafe15d4ea79ae6abcddc360dd2de35b44e", - "sha256": "1nn602v3ssj79rxdfl3ical10c1d632vji9nv2h0dqslmycg4aws", - "type": "tarball", - "url": "https://github.com/NixOS/nixpkgs-channels/archive/5ad1cdafe15d4ea79ae6abcddc360dd2de35b44e.tar.gz", - "url_template": "https://github.com///archive/.tar.gz" - }, - "nixpkgs-mozilla": { - "branch": "master", - "description": "mozilla related nixpkgs (extends nixos/nixpkgs repo)", - "homepage": null, - "owner": "mozilla", - "repo": "nixpkgs-mozilla", - "rev": "efda5b357451dbb0431f983cca679ae3cd9b9829", - "sha256": "11wqrg86g3qva67vnk81ynvqyfj0zxk83cbrf0p9hsvxiwxs8469", - "type": "tarball", - "url": "https://github.com/mozilla/nixpkgs-mozilla/archive/efda5b357451dbb0431f983cca679ae3cd9b9829.tar.gz", - "url_template": "https://github.com///archive/.tar.gz" - }, - "olin": { - "branch": "master", - "description": "Webassembly + Event Sourcing", - "homepage": "", - "owner": "Xe", - "repo": "olin", - "rev": "0e8c8eea725307f8f396919cbf7f965a0d67b0e0", - "sha256": "14fixl444pkdv6dcrjfk6vhxyi555j6y95i85ryjfwz0q2axmjxg", - "type": "tarball", - "url": "https://github.com/Xe/olin/archive/0e8c8eea725307f8f396919cbf7f965a0d67b0e0.tar.gz", - "url_template": "https://github.com///archive/.tar.gz" - } -} diff --git a/nix/sources.nix b/nix/sources.nix deleted file mode 100644 index 8a725cb..0000000 --- a/nix/sources.nix +++ /dev/null @@ -1,134 +0,0 @@ -# This file has been generated by Niv. - -let - - # - # The fetchers. fetch_ fetches specs of type . - # - - fetch_file = pkgs: spec: - if spec.builtin or true then - builtins_fetchurl { inherit (spec) url sha256; } - else - pkgs.fetchurl { inherit (spec) url sha256; }; - - fetch_tarball = pkgs: spec: - if spec.builtin or true then - builtins_fetchTarball { inherit (spec) url sha256; } - else - pkgs.fetchzip { inherit (spec) url sha256; }; - - fetch_git = spec: - builtins.fetchGit { url = spec.repo; inherit (spec) rev ref; }; - - fetch_builtin-tarball = spec: - builtins.trace - '' - WARNING: - The niv type "builtin-tarball" will soon be deprecated. You should - instead use `builtin = true`. - - $ niv modify -a type=tarball -a builtin=true - '' - builtins_fetchTarball { inherit (spec) url sha256; }; - - fetch_builtin-url = spec: - builtins.trace - '' - WARNING: - The niv type "builtin-url" will soon be deprecated. You should - instead use `builtin = true`. - - $ niv modify -a type=file -a builtin=true - '' - (builtins_fetchurl { inherit (spec) url sha256; }); - - # - # Various helpers - # - - # The set of packages used when specs are fetched using non-builtins. - mkPkgs = sources: - let - sourcesNixpkgs = - import (builtins_fetchTarball { inherit (sources.nixpkgs) url sha256; }) {}; - hasNixpkgsPath = builtins.any (x: x.prefix == "nixpkgs") builtins.nixPath; - hasThisAsNixpkgsPath = == ./.; - in - if builtins.hasAttr "nixpkgs" sources - then sourcesNixpkgs - else if hasNixpkgsPath && ! hasThisAsNixpkgsPath then - import {} - else - abort - '' - Please specify either (through -I or NIX_PATH=nixpkgs=...) or - add a package called "nixpkgs" to your sources.json. - ''; - - # The actual fetching function. - fetch = pkgs: name: spec: - - if ! builtins.hasAttr "type" spec then - abort "ERROR: niv spec ${name} does not have a 'type' attribute" - else if spec.type == "file" then fetch_file pkgs spec - else if spec.type == "tarball" then fetch_tarball pkgs spec - else if spec.type == "git" then fetch_git spec - else if spec.type == "builtin-tarball" then fetch_builtin-tarball spec - else if spec.type == "builtin-url" then fetch_builtin-url spec - else - abort "ERROR: niv spec ${name} has unknown type ${builtins.toJSON spec.type}"; - - # Ports of functions for older nix versions - - # a Nix version of mapAttrs if the built-in doesn't exist - mapAttrs = builtins.mapAttrs or ( - f: set: with builtins; - listToAttrs (map (attr: { name = attr; value = f attr set.${attr}; }) (attrNames set)) - ); - - # fetchTarball version that is compatible between all the versions of Nix - builtins_fetchTarball = { url, sha256 }@attrs: - let - inherit (builtins) lessThan nixVersion fetchTarball; - in - if lessThan nixVersion "1.12" then - fetchTarball { inherit url; } - else - fetchTarball attrs; - - # fetchurl version that is compatible between all the versions of Nix - builtins_fetchurl = { url, sha256 }@attrs: - let - inherit (builtins) lessThan nixVersion fetchurl; - in - if lessThan nixVersion "1.12" then - fetchurl { inherit url; } - else - fetchurl attrs; - - # Create the final "sources" from the config - mkSources = config: - mapAttrs ( - name: spec: - if builtins.hasAttr "outPath" spec - then abort - "The values in sources.json should not have an 'outPath' attribute" - else - spec // { outPath = fetch config.pkgs name spec; } - ) config.sources; - - # The "config" used by the fetchers - mkConfig = - { sourcesFile ? ./sources.json - , sources ? builtins.fromJSON (builtins.readFile sourcesFile) - , pkgs ? mkPkgs sources - }: rec { - # The sources, i.e. the attribute set of spec name to spec - inherit sources; - - # The "pkgs" (evaluated nixpkgs) to use for e.g. non-builtin fetchers - inherit pkgs; - }; -in -mkSources (mkConfig {}) // { __functor = _: settings: mkSources (mkConfig settings); } diff --git a/olin-spec/default.nix b/olin-spec/default.nix index 62beeaa..515c9fc 100644 --- a/olin-spec/default.nix +++ b/olin-spec/default.nix @@ -1,5 +1,4 @@ -{ sources ? import ../nix/sources.nix, pkgs ? import sources.nixpkgs { } -, dhall-lang ? sources.dhall-lang, dhall ? import ../nix/dhall.nix }: +{ pkgs, dhall-lang, dhall }: pkgs.stdenv.mkDerivation rec { name = "olin-spec"; version = "latest"; diff --git a/shell.nix b/shell.nix deleted file mode 100644 index d0f54aa..0000000 --- a/shell.nix +++ /dev/null @@ -1,35 +0,0 @@ -let - sources = import ./nix/sources.nix; - niv = import sources.niv { }; - pkgs = import sources.nixpkgs { }; - olin = import sources.olin { inherit pkgs; }; - rust = import ./nix/rust.nix { inherit sources; }; - dhall = import ./nix/dhall.nix; -in pkgs.mkShell { - buildInputs = [ - rust - - # benchmarks - pkgs.hyperfine - - # dependency management - niv.niv - - # native dependencies - pkgs.openssl - pkgs.pkg-config - - # olin-docs - dhall.dhall-simple - sources.dhall-lang - - # tests - pkgs.go - olin - ]; - nativeBuildInputs = [ pkgs.removeReferencesTo ]; - - # envvars - RUST_LOG = "pahi=error,pahi_olin=debug"; - MAGIC_CONCH = "yes"; -} diff --git a/tests/default.nix b/tests/default.nix index 0927752..c0e3aad 100644 --- a/tests/default.nix +++ b/tests/default.nix @@ -1,4 +1,4 @@ -{ sources ? import ../nix/sources.nix, pkgs ? import sources.nixpkgs { } }: +{ pkgs }: with pkgs; buildGoPackage { name = "pahi-tests";