From 8c571c2dbe11419cf0a6e3242fb9e06089dcf652 Mon Sep 17 00:00:00 2001 From: Valentin Gagarin Date: Fri, 25 Jul 2025 12:03:58 +0200 Subject: [PATCH] WIP: get past dumb type error --- deployment/data-model-test.nix | 50 ++++++++++++++++++---------------- 1 file changed, 27 insertions(+), 23 deletions(-) diff --git a/deployment/data-model-test.nix b/deployment/data-model-test.nix index c47deb78..5b0c4d29 100644 --- a/deployment/data-model-test.nix +++ b/deployment/data-model-test.nix @@ -119,27 +119,29 @@ in { config, ... }: { resources.shell.login-shell.username = "operator"; - implementation = - requests: - { providers, ... }: - { - providers = { - inherit (inputs.nixops4.modules.nixops4Provider) local; + implementation = requests: { + input = requests; + output = + { providers, ... }: + { + providers = { + inherit (inputs.nixops4.modules.nixops4Provider) local; + }; + resources.the-machine = { + type = providers.local.exec; + imports = [ + inputs.nixops4-nixos.modules.nixops4Resource.nixos + ]; + nixos.module = + { ... }: + { + users.users = config.resources.shell.login-shell.apply ( + lib.filterAttrs (_name: value: value ? login-shell) requests + ); + }; + }; }; - resources.the-machine = { - type = providers.local.exec; - imports = [ - inputs.nixops4-nixos.modules.nixops4Resource.nixos - ]; - nixos.module = - { ... }: - { - users.users = config.resources.shell.login-shell.apply ( - lib.filterAttrs (_name: value: value ? login-shell) requests - ); - }; - }; - }; + }; }; }; options = { @@ -162,18 +164,20 @@ in in rec { number-of-resources = with lib; length (attrNames fediversity.resources); - config = fediversity.example-configuration; + inherit (fediversity) example-configuration; hello-package-exists = - (fediversity.applications.hello.resources config.applications.hello) + (fediversity.applications.hello.resources example-configuration.applications.hello) .resources.hello.login-shell.packages ? hello; + inherit (fediversity) example-deployment; }; expected = { number-of-resources = 2; - config = { + example-configuration = { enable = true; applications.hello.enable = true; }; hello-package-exists = true; + example-deployment = { }; }; }; }