From 8a676024694c70be3e7663af2ea89825557d86fc Mon Sep 17 00:00:00 2001 From: Johannes Kirschbauer Date: Sun, 30 Mar 2025 16:12:01 +0200 Subject: [PATCH] feat(lib/modules): remove dependency on self --- lib/default.nix | 4 +--- lib/frontmatter/default.nix | 6 +++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/lib/default.nix b/lib/default.nix index 359bbb8f7..80d69b3ce 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -28,11 +28,9 @@ lib.fix (clanLib: { inherit lib; clan-core = self; }; - modules = import ./frontmatter { - inherit lib self; - }; # ------------------------------------ # Lib functions that don't depend on 'self' + modules = clanLib.callLib ./frontmatter { }; facts = import ./facts.nix { inherit lib; }; values = import ./values { inherit lib; }; jsonschema = import ./jsonschema { inherit lib; }; diff --git a/lib/frontmatter/default.nix b/lib/frontmatter/default.nix index 9e34e8f68..0302a2633 100644 --- a/lib/frontmatter/default.nix +++ b/lib/frontmatter/default.nix @@ -1,9 +1,9 @@ -{ lib, self }: +{ lib, clanLib }: let # Trim the .nix extension from a filename trimExtension = name: builtins.substring 0 (builtins.stringLength name - 4) name; - jsonWithoutHeader = self.lib.jsonschema { + jsonWithoutHeader = clanLib.jsonschema { includeDefaults = true; header = { }; }; @@ -13,7 +13,7 @@ let lib.mapAttrs ( _moduleName: rolesOptions: lib.mapAttrs (_roleName: options: jsonWithoutHeader.parseOptions options { }) rolesOptions - ) (self.lib.evalClanModulesWithRoles modules); + ) (clanLib.evalClanModulesWithRoles modules); evalFrontmatter = {