Add script/test

This commit is contained in:
Nicolas Mattia 2019-12-02 16:42:05 +01:00
parent cfcc58495d
commit 2c6c9ddc46
4 changed files with 24 additions and 2 deletions

View file

@ -38,7 +38,7 @@ jobs:
- run:
name: Nix build
command: nix-build --sandbox --no-link --cores 0 ./test.nix
command: ./script/test
workflows:
version: 2

4
nix/default.nix Normal file
View file

@ -0,0 +1,4 @@
{ system ? builtins.currentSystem }:
let
sources = import ./sources.nix;
in import sources.nixpkgs { inherit system; }

18
script/test Executable file
View file

@ -0,0 +1,18 @@
#!/usr/bin/env nix-shell
#!nix-shell -i bash
#!nix-shell -I nixpkgs=./nix
#!nix-shell -p nix
#!nix-shell --pure
#!nix-shell --keep SSL_CERT_FILE
#!nix-shell --keep NIX_SSL_CERT_FILE
set -euo pipefail
export NIX_PATH="nixpkgs=./nix"
echo "Building"
# Build and create a root
nix-build ./test.nix --sandbox --no-link --max-jobs 10
echo "all good"

View file

@ -1,7 +1,7 @@
{ system ? builtins.currentSystem }:
let
sources = import ./nix/sources.nix;
pkgs = import sources.nixpkgs { inherit system; };
pkgs = import ./nix { inherit system; };
naersk = pkgs.callPackage ./default.nix
{ inherit (pkgs.rustPackages) cargo rustc; };
builtinz = builtins // pkgs.callPackage ./builtins {};