fix infinite recursion

This commit is contained in:
Jörg Thalheim
2025-02-03 10:58:55 +07:00
committed by Johannes Kirschbauer
parent b013b9d6e7
commit eee6415261
4 changed files with 4 additions and 14 deletions

View File

@@ -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" ];

View File

@@ -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

View File

@@ -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";

View File

@@ -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;
}
);