From 2774f3ea91144eb7ae92a5b5eb3ff5a30b6a4c07 Mon Sep 17 00:00:00 2001 From: technofab Date: Tue, 5 Aug 2025 16:15:24 +0200 Subject: [PATCH] chore: minor improvements & add blocks --- flake.nix | 7 ++----- lib/blocks/default.nix | 9 +++++++++ lib/core/loader.nix | 3 +-- lib/default.nix | 4 ++-- 4 files changed, 14 insertions(+), 9 deletions(-) diff --git a/flake.nix b/flake.nix index 70f677d..7995277 100644 --- a/flake.nix +++ b/flake.nix @@ -11,11 +11,8 @@ rensa.buildWith { inherit inputs; cellsFrom = ./cells; - cellBlocks = [ - { - name = "test"; - type = "test"; - } + cellBlocks = with rensa.blocks; [ + (simple "test") ]; } {}; } diff --git a/lib/blocks/default.nix b/lib/blocks/default.nix index 2c63c08..7f83c8d 100644 --- a/lib/blocks/default.nix +++ b/lib/blocks/default.nix @@ -1,2 +1,11 @@ { + simple = name: { + inherit name; + type = name; + }; + dynamic = name: { + inherit name; + type = name; + # TODO: dynamic actions + }; } diff --git a/lib/core/loader.nix b/lib/core/loader.nix index 4809640..88d30c1 100644 --- a/lib/core/loader.nix +++ b/lib/core/loader.nix @@ -47,7 +47,6 @@ } else throw "Neither ${blockP.file} nor ${blockP.dir} exist, this shouldn't happen!"; - targetTracer = name: l.traceVerbose "[ren] loading, system=${system} path=${importPaths.importPath} name=${name}"; imported = import' importPaths.importPath; isAttrs = builtins.isAttrs imported; @@ -70,7 +69,7 @@ ) else {}; in { - init = targetTracer name { + init = l.traceVerbose "[ren] loading, system=${system} path=${importPaths.importPath} name=${name}" { inherit name; actions = l.mapAttrsToList (name: a: { diff --git a/lib/default.nix b/lib/default.nix index 69896b9..d76620f 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -3,9 +3,9 @@ utils = import ./utils {inherit l;}; core = import ./core {inherit l utils;}; compat = import ./compat {inherit l;}; + blocks = import ./blocks; in { inherit (compat) filter select get; inherit (core) build buildWith; - # TODO: - # blocks = import ./blocks; + inherit blocks; }