From eee64152614c3d3ff8ecab4fbeb509b83017658e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Mon, 3 Feb 2025 10:58:55 +0700 Subject: [PATCH] fix infinite recursion --- lib/build-clan/default.nix | 10 +--------- lib/build-clan/eval.nix | 2 -- lib/build-clan/interface.nix | 2 +- lib/build-clan/module.nix | 4 ++-- 4 files changed, 4 insertions(+), 14 deletions(-) diff --git a/lib/build-clan/default.nix b/lib/build-clan/default.nix index 60c4e494a..3089cc2aa 100644 --- a/lib/build-clan/default.nix +++ b/lib/build-clan/default.nix @@ -9,7 +9,6 @@ { ## Inputs self ? null, # Reference to the current flake - directory ? null, # the directory containing the machines subdirectory. Optional: can be used if the machines is not in the root of the flake # allows to include machine-specific modules i.e. machines.${name} = { ... } # A map from arch to pkgs, if specified this nixpkgs will be only imported once for each system. # This improves performance, but all nipxkgs.* options will be ignored. @@ -26,16 +25,9 @@ let lib nixpkgs clan-core + self ; inherit specialArgs; - self = - if self == null then - lib.warn "The buildClan function requires argument 'self' to be set to the current flake" { - inputs = { }; - } - else - self; - directory = if directory == null then self else directory; }; rest = builtins.removeAttrs attrs [ "specialArgs" ]; diff --git a/lib/build-clan/eval.nix b/lib/build-clan/eval.nix index bb1add813..4a11fd1e0 100644 --- a/lib/build-clan/eval.nix +++ b/lib/build-clan/eval.nix @@ -3,7 +3,6 @@ nixpkgs, clan-core, self, - directory ? null, specialArgs ? { }, }: # Returns a function that takes self, which should point to the directory of the flake @@ -17,7 +16,6 @@ module: module { inherit specialArgs; - directory = lib.mkIf (directory != null) directory; } ]; }).config diff --git a/lib/build-clan/interface.nix b/lib/build-clan/interface.nix index c1e534296..a264bfd95 100644 --- a/lib/build-clan/interface.nix +++ b/lib/build-clan/interface.nix @@ -9,7 +9,7 @@ in { options = { self = lib.mkOption { - type = types.raw; + type = types.nullOr types.raw; default = self; readOnly = true; defaultText = "Reference to the current flake"; diff --git a/lib/build-clan/module.nix b/lib/build-clan/module.nix index 16d22f158..ed7ed475b 100644 --- a/lib/build-clan/module.nix +++ b/lib/build-clan/module.nix @@ -1,3 +1,4 @@ +# NixOS module { config, clan-core, @@ -43,8 +44,7 @@ let # { ${machineName} :: Config } serviceConfigs = ( buildInventory { - inherit inventory; - inherit directory; + inherit inventory directory; } );