Skip to content

Commit

Permalink
Modularize tests, use pkgs.path
Browse files Browse the repository at this point in the history
  • Loading branch information
Baughn committed Dec 30, 2018
1 parent 6dfbb2e commit 26e05c1
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 31 deletions.
3 changes: 1 addition & 2 deletions build.sh
Expand Up @@ -78,8 +78,7 @@ update() {
update
echo 'Building all system configurations.'
nix build -f machines.nix all --show-trace
nixops deploy -d personal --check -j 8 --cores 16 -I "nixpkgs=$NIXPKGS" --build-only
echo 'Spreading secrets.'
for machine in secrets/shared/*; do
Expand Down
28 changes: 0 additions & 28 deletions machines.nix

This file was deleted.

2 changes: 1 addition & 1 deletion modules/basics.nix
Expand Up @@ -14,7 +14,7 @@

# Nix propagation
environment.etc = {
nix-system-pkgs.source = /home/svein/dev/nix/system;
nix-system-pkgs.source = pkgs.path;
nixos.source = builtins.filterSource
(path: type:
baseNameOf path != "secrets"
Expand Down
1 change: 1 addition & 0 deletions modules/default.nix
Expand Up @@ -4,5 +4,6 @@
imports = [
./basics.nix
./zfs.nix
./tests.nix
];
}
24 changes: 24 additions & 0 deletions modules/tests.nix
@@ -0,0 +1,24 @@
{ config, pkgs, ... }:

let
test = file: (import (pkgs.path + "/nixos/tests/${file}.nix") {
inherit config;
});

xmonad = test "xmonad";

tests = pkgs.runCommand "proof-of-tests" {
tests = [ xmonad ];
} ''
mkdir -p $out/share/doc/proof-of-tests
i=1
for test in $tests; do
ln -s $test $out/share/doc/proof-of-tests/$i
i=$(($i + 1))
done
'';
in {
environment.systemPackages = [
tests
];
}

0 comments on commit 26e05c1

Please sign in to comment.