summaryrefslogtreecommitdiff
path: root/release.nix
diff options
context:
space:
mode:
authorDaiderd Jordan <daiderd@gmail.com>2017-03-11 10:03:37 +0100
committerDaiderd Jordan <daiderd@gmail.com>2017-03-11 10:03:37 +0100
commit8a67d1d4cf8611c628558b0e816dce5a853d9436 (patch)
tree8d460988a88ceb42913ee0f9ae8097111864187e /release.nix
parent337c85e1c3d40faa4d1e54d4c3922a554a602c85 (diff)
add tests to release.nix
Diffstat (limited to 'release.nix')
-rw-r--r--release.nix41
1 files changed, 41 insertions, 0 deletions
diff --git a/release.nix b/release.nix
index 50d114d..eb1afa2 100644
--- a/release.nix
+++ b/release.nix
@@ -13,6 +13,45 @@ let
(import ./. { inherit nixpkgs configuration system; }).system
);
+ makeTest = test:
+ pkgs.lib.genAttrs [ "x86_64-darwin" ] (system:
+ let
+ configuration =
+ { config, lib, pkgs, ... }:
+ with lib;
+ { imports = [ test ];
+
+ options = {
+ out = mkOption {
+ type = types.package;
+ };
+
+ test = mkOption {
+ type = types.lines;
+ };
+ };
+
+ config = {
+ system.build.run-test = pkgs.runCommand "run-darwin-test"
+ { allowSubstitutes = false;
+ preferLocalBuild = true;
+ }
+ ''
+ #! ${pkgs.stdenv.shell}
+ set -e
+
+ ${config.test}
+ echo ok | tee $out >&2
+ '';
+
+ out = config.system.build.toplevel;
+ };
+ };
+ system = "x86_64-darwin";
+ in
+ (import ./. { inherit nixpkgs configuration system; }).config.system.build.run-test
+ );
+
release = import <nixpkgs/pkgs/top-level/release-lib.nix> {
inherit supportedSystems scrubJobs;
packageSet = import nixpkgs;
@@ -49,6 +88,8 @@ let
examples.lnl = genExample ./modules/examples/lnl.nix;
examples.simple = genExample ./modules/examples/simple.nix;
+ tests.system-packages = makeTest ./tests/system-packages.nix;
+
}
// (mapTestOn (packagePlatforms packageSet));