summary refs log tree commit diff
path: root/nixos/modules/misc/assertions.nix
diff options
context:
space:
mode:
authorShea Levy <shea@shealevy.com>2014-04-21 11:46:16 -0400
committerShea Levy <shea@shealevy.com>2014-04-22 14:09:02 -0400
commit7d1ddae58e465a1708967c9fee651c33819969c6 (patch)
tree7a71354c5c1c8a8e8959a9f696af4d077df821ac /nixos/modules/misc/assertions.nix
parent5ba24cc8ea7c3979a174142393d155bbc32167cf (diff)
downloadnixpkgs-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.nix20
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 "warning: ${w}" 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>
 }