From 89b22df3a46b9c5c041b780ca0eceb942e5a6b96 Mon Sep 17 00:00:00 2001 From: Valentin Gagarin Date: Thu, 24 Jul 2025 20:08:29 +0200 Subject: [PATCH] WIP(broken, infinite recursion): apply application config --- deployment/data-model-test.nix | 12 +++++++----- deployment/data-model.nix | 6 ++++-- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/deployment/data-model-test.nix b/deployment/data-model-test.nix index c7350019..d2d4f2fc 100644 --- a/deployment/data-model-test.nix +++ b/deployment/data-model-test.nix @@ -108,13 +108,14 @@ in { options.enable = lib.mkEnableOption "Hello in the shell"; }; - implementation = - cfg: - lib.optionalAttrs cfg.enable { - hello.login-shell.packages = { + implementation = cfg: { + input = cfg; + output = lib.optionalAttrs cfg.enable { + resources.hello.login-shell.packages = { inherit (pkgs) hello; }; }; + }; }; environments.single-nixos-vm = { config, ... }: @@ -161,8 +162,9 @@ in } ); in - { + rec { config = fediversity.example-configuration; + resources = fediversity.applications.hello.implementation config.applications.hello; }; expected = { config = { diff --git a/deployment/data-model.nix b/deployment/data-model.nix index b14f4c8f..d3361f16 100644 --- a/deployment/data-model.nix +++ b/deployment/data-model.nix @@ -21,7 +21,9 @@ let options.resources = mkOption { # TODO: maybe transpose, and group the resources by type instead type = attrsOf ( - attrTag (lib.mapAttrs (_name: resource: mkOption { type = resource.request; }) config.resources) + attrTag ( + lib.mapAttrs (_name: resource: mkOption { type = submodule resource.request; }) config.resources + ) ); }; }; @@ -114,7 +116,7 @@ in type = submodule functionType; readOnly = true; default = { - input-type = application.config.module; + input-type = submodule application.config.module; output-type = application-resources; }; };