nix: add function to catch currentSystem used anywhere

This commit is contained in:
Primrose 2025-08-03 09:51:08 +02:00
parent 8d37d38195
commit f83a35403e
Signed by: primrose
GPG key ID: 4E887A4CA9714ADA

View file

@ -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")) {