From f83a35403eb1d2e59efd8920069f3b548b68f449 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9ana=20=E6=B1=9F?= Date: Sun, 3 Aug 2025 09:51:08 +0200 Subject: [PATCH] nix: add function to catch currentSystem used anywhere --- default.nix | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/default.nix b/default.nix index 0a0f3316..531e8e87 100644 --- a/default.nix +++ b/default.nix @@ -1,4 +1,14 @@ -{sources ? import ./npins}: { +{sources ? import ./npins}: let + # Catch where currentSystem is evaluated + fakeImport = builtins.scopedImport { + builtins = + builtins + // { + currentSystem = throw "`currentSystem' is disabled"; + }; + import = fakeImport; + }; +in { lib = import (sources.nixpkgs + "/lib"); nixosConfigurations = builtins.mapAttrs (_: import (sources.nixpkgs + "/nixos/lib/eval-config.nix")) {