diff options
author | Shea Levy <shea@shealevy.com> | 2014-04-21 11:46:16 -0400 |
---|---|---|
committer | Shea Levy <shea@shealevy.com> | 2014-04-22 14:09:02 -0400 |
commit | 7d1ddae58e465a1708967c9fee651c33819969c6 (patch) | |
tree | 7a71354c5c1c8a8e8959a9f696af4d077df821ac /nixos/modules/misc/assertions.nix | |
parent | 5ba24cc8ea7c3979a174142393d155bbc32167cf (diff) | |
download | nixpkgs-7d1ddae58e465a1708967c9fee651c33819969c6.tar nixpkgs-7d1ddae58e465a1708967c9fee651c33819969c6.tar.gz nixpkgs-7d1ddae58e465a1708967c9fee651c33819969c6.tar.bz2 nixpkgs-7d1ddae58e465a1708967c9fee651c33819969c6.tar.lz nixpkgs-7d1ddae58e465a1708967c9fee651c33819969c6.tar.xz nixpkgs-7d1ddae58e465a1708967c9fee651c33819969c6.tar.zst nixpkgs-7d1ddae58e465a1708967c9fee651c33819969c6.zip |
nixos: evaluate assertions at toplevel, not at systemPackages
Fixes #2340
Diffstat (limited to 'nixos/modules/misc/assertions.nix')
-rw-r--r-- | nixos/modules/misc/assertions.nix | 20 |
1 files changed, 1 insertions, 19 deletions
diff --git a/nixos/modules/misc/assertions.nix b/nixos/modules/misc/assertions.nix index 786ec7d250c..c1be36e98cb 100644 --- a/nixos/modules/misc/assertions.nix +++ b/nixos/modules/misc/assertions.nix @@ -2,14 +2,6 @@ with lib; -let - - failed = map (x: x.message) (filter (x: !x.assertion) config.assertions); - - showWarnings = res: fold (w: x: builtins.trace "[1;31mwarning: ${w}[0m" x) res config.warnings; - -in - { options = { @@ -38,15 +30,5 @@ in }; }; - - config = { - - # This option is evaluated always. Thus the assertions are checked - # as well. Hacky! - environment.systemPackages = showWarnings ( - if [] == failed then [] - else throw "\nFailed assertions:\n${concatStringsSep "\n" (map (x: "- ${x}") failed)}"); - - }; - + # impl of assertions is in <nixos/modules/system/activation/top-level.nix> } |