From 043605cfec0344b029947c306957695a2b1a1d4d Mon Sep 17 00:00:00 2001 From: Yegor Timoshenko Date: Tue, 17 Jul 2018 15:27:07 +0300 Subject: [PATCH] Fix tests --- .travis.yml | 2 +- default.nix | 47 ++++++++++++++++++++++++++++++++++++++++++++++- tests/eval.nix | 15 --------------- tests/eval.sh | 16 ---------------- 4 files changed, 47 insertions(+), 33 deletions(-) delete mode 100644 tests/eval.nix delete mode 100755 tests/eval.sh diff --git a/.travis.yml b/.travis.yml index 4035b29..689c9b6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,2 +1,2 @@ language: nix -script: tests/eval.sh +script: nix-build --dry-run --show-trace diff --git a/default.nix b/default.nix index c157af7..bf72211 100644 --- a/default.nix +++ b/default.nix @@ -1 +1,46 @@ -{ ... }: {} +{ ... }: + +let + shim = { + boot.loader.systemd-boot.enable = true; + + fileSystems."/" = { + device = "/dev/disk/by-uuid/00000000-0000-0000-0000-000000000000"; + fsType = "btrfs"; + }; + + nixpkgs.config = { + allowBroken = true; + allowUnfree = true; + }; + }; + + buildProfile = profile: (import { + configuration.imports = [ profile shim ]; + }).system; +in + +{ + acer-aspire-4810t = buildProfile ./acer/aspire/4810t; + + airis-n990 = buildProfile ./airis/n990; + + apple-macbook-air-4 = buildProfile ./apple/macbook-air/4; + apple-macbook-air-6 = buildProfile ./apple/macbook-air/6; + apple-macbook-pro-10-1 = buildProfile ./apple/macbook-pro/10-1; + apple-macbook-pro-12-1 = buildProfile ./apple/macbook-pro/12-1; + + dell-xps-15-9550 = buildProfile ./dell/xps/15-9550; + + lenovo-thinkpad-t410 = buildProfile ./lenovo/thinkpad/t410; + lenovo-thinkpad-t440p = buildProfile ./lenovo/thinkpad/t440p; + lenovo-thinkpad-t460s = buildProfile ./lenovo/thinkpad/t460s; + lenovo-thinkpad-x140e = buildProfile ./lenovo/thinkpad/x140e; + lenovo-thinkpad-x220 = buildProfile ./lenovo/thinkpad/x220; + lenovo-thinkpad-x230 = buildProfile ./lenovo/thinkpad/x230; + lenovo-thinkpad-x250 = buildProfile ./lenovo/thinkpad/x250; + + microsoft-surface-pro-3 = buildProfile ./microsoft/surface-pro/3; + + pcengines-apu = buildProfile ./pcengines/apu; +} diff --git a/tests/eval.nix b/tests/eval.nix deleted file mode 100644 index e946b0b..0000000 --- a/tests/eval.nix +++ /dev/null @@ -1,15 +0,0 @@ -{ - imports = [ ]; - - boot.loader.systemd-boot.enable = true; - - fileSystems."/" = { - device = "/dev/disk/by-uuid/00000000-0000-0000-0000-000000000000"; - fsType = "btrfs"; - }; - - nixpkgs.config = { - allowBroken = true; - allowUnfree = true; - }; -} diff --git a/tests/eval.sh b/tests/eval.sh deleted file mode 100755 index 0f21fe3..0000000 --- a/tests/eval.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh - -set -e - -cd "$(dirname "$0")/.." - -for profile in $(find . -name default.nix); do - echo evaluating $profile >&2 - - nix-build '' \ - -I nixos-config=tests/eval.nix \ - -I nixos-hardware-profile=$profile \ - -A system \ - --dry-run \ - --show-trace -done