From ba047997f2ff294cb28556a01bbfba4b414e743c Mon Sep 17 00:00:00 2001 From: Valentin Gagarin Date: Thu, 3 Jul 2025 13:08:14 +0200 Subject: [PATCH] WIP: illustrate an entire NixOS configuration as a resource --- deployment/data-model-test.nix | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/deployment/data-model-test.nix b/deployment/data-model-test.nix index 2817a2c4..1e0222c7 100644 --- a/deployment/data-model-test.nix +++ b/deployment/data-model-test.nix @@ -23,6 +23,33 @@ in { config, ... }: { config = { + resources.nixos-configuration = { + description = "An entire NixOS configuration"; + request = + { ... }: + { + _class = "fediversity-resource-request"; + options.config = mkOption { + description = "Any options from NixOS"; + }; + }; + + policy = + { config, ... }: + { + _class = "fediversity-resource-policy"; + + options = { + extra-config = mkOptions { + description = "Any options from NixOS"; + }; + apply = mkOption { + type = with types; functionTo raw; + default = requests: lib.mkMerge (requests ++ [ config.extra-config ]); + }; + }; + }; + }; resources.login-shell = { description = "The operator needs to be able to log into the shell"; request = @@ -137,7 +164,8 @@ in { inherit (fediversity) example-deployment; }; - expected = { - }; + expected = + { + }; }; }