From 2ed3ca511ff0c5d18ebf09047a34a700236110c7 Mon Sep 17 00:00:00 2001 From: Daiderd Jordan Date: Mon, 15 May 2017 20:35:30 +0200 Subject: [PATCH] add test for default environment.systemPath --- release.nix | 2 ++ tests/environment-path.nix | 15 +++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 tests/environment-path.nix diff --git a/release.nix b/release.nix index b0d5e792..dd8e0a76 100644 --- a/release.nix +++ b/release.nix @@ -88,6 +88,8 @@ let examples.lnl = genExample ./modules/examples/lnl.nix; examples.simple = genExample ./modules/examples/simple.nix; + tests.environment-path = makeTest ./tests/environment-path.nix; + tests.services-activate-system = makeTest ./tests/services-activate-system.nix; tests.system-defaults-write = makeTest ./tests/system-defaults-write.nix; diff --git a/tests/environment-path.nix b/tests/environment-path.nix new file mode 100644 index 00000000..d0f3d849 --- /dev/null +++ b/tests/environment-path.nix @@ -0,0 +1,15 @@ +{ config, lib, pkgs, ... }: + +with lib; + +{ + programs.bash.enable = true; + + test = '' + echo checking /run/current-system/sw/bin in systemPath >&2 + grep 'export PATH=.*:/run/current-system/sw/bin' ${config.out}/etc/bashrc + + echo checking /bin and /sbin in systemPath >&2 + grep 'export PATH=.*:/usr/bin:/usr/sbin:/bin:/sbin' ${config.out}/etc/bashrc + ''; +}