From 967bb2bcbd9c922e74f5408e1f0e4ccbf559be15 Mon Sep 17 00:00:00 2001 From: Kiara Grouwstra Date: Sun, 17 Aug 2025 13:21:37 +0200 Subject: [PATCH] properly use modular function application to ensure parameter type-checks --- deployment/data-model-test.nix | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/deployment/data-model-test.nix b/deployment/data-model-test.nix index 1978be34..9316c55c 100644 --- a/deployment/data-model-test.nix +++ b/deployment/data-model-test.nix @@ -98,20 +98,27 @@ in { options.enable = lib.mkEnableOption "Hello in the shell"; }; - implementation = cfg: { - input = cfg; - output = lib.optionalAttrs cfg.enable { - resources.hello.login-shell.packages.hello = pkgs.hello; - }; + implementation = input: fn: { + inherit input; + output = + let + cfg = fn.config.input; + in + lib.optionalAttrs cfg.enable { + resources.hello.login-shell.packages.hello = pkgs.hello; + }; }; }; environments.single-nixos-vm = { config, ... }: { resources.operator-environment.login-shell.username = "operator"; - implementation = requests: { - input = requests; + implementation = input: fn: { + inherit input; output = + let + requests = fn.config.input; + in { providers, ... }: { providers = {