From a6b470ea405415c5974502d1a2c63f6bad1ee24b Mon Sep 17 00:00:00 2001 From: eljamm Date: Mon, 5 May 2025 19:34:58 +0200 Subject: [PATCH 1/4] fix: access types recursively in types.nix --- projects/types.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/types.nix b/projects/types.nix index 4bd4375cc..3c4393f7f 100644 --- a/projects/types.nix +++ b/projects/types.nix @@ -8,7 +8,7 @@ let mkOption ; in -{ +rec { subgrant = with types; submodule { From 39823711d50cde9d4d4dc9954657d76ff2ea5894 Mon Sep 17 00:00:00 2001 From: eljamm Date: Mon, 5 May 2025 19:36:56 +0200 Subject: [PATCH 2/4] fix: use deferredModule --- projects/types.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/projects/types.nix b/projects/types.nix index 3c4393f7f..7c1f8600b 100644 --- a/projects/types.nix +++ b/projects/types.nix @@ -97,7 +97,7 @@ rec { options = { module = mkOption { description = "the example must be a NixOS module in a file"; - type = pathInStore; + type = deferredModule; }; description = mkOption { description = "description of the example, ideally with further instructions on how to use it"; @@ -151,7 +151,7 @@ rec { default = name; }; module = mkOption { - type = moduleType; + type = deferredModule; }; examples = mkOption { type = nullOr (attrsOf (nullOr example)); From 267856efd52553a477af69e6ad6ce751df846563 Mon Sep 17 00:00:00 2001 From: eljamm Date: Fri, 16 May 2025 10:43:36 +0200 Subject: [PATCH 3/4] fix: modules for services and programs --- projects/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/projects/default.nix b/projects/default.nix index af49837e7..d88f47b6a 100644 --- a/projects/default.nix +++ b/projects/default.nix @@ -86,11 +86,11 @@ in with types; submodule { options = { - services = mkOption { + modules.services = mkOption { type = nullOr (attrsOf (nullOr types'.service)); default = null; }; - programs = mkOption { + modules.programs = mkOption { type = nullOr (attrsOf (nullOr types'.program)); default = null; }; From b87ae6936720df65b556da298b5fab4cbeeb5195 Mon Sep 17 00:00:00 2001 From: eljamm Date: Tue, 6 May 2025 13:19:46 +0200 Subject: [PATCH 4/4] fix: add name option for programs --- projects/types.nix | 43 +++++++++++++++++++++++++------------------ 1 file changed, 25 insertions(+), 18 deletions(-) diff --git a/projects/types.nix b/projects/types.nix index 7c1f8600b..dfb123807 100644 --- a/projects/types.nix +++ b/projects/types.nix @@ -119,25 +119,32 @@ rec { # TODO: port modular services to programs program = with types; - submodule { - options = { - module = mkOption { - type = deferredModule; - }; - examples = mkOption { - type = attrsOf (nullOr example); - default = { }; - }; - extensions = mkOption { - type = attrsOf (nullOr plugin); - default = { }; - }; - links = mkOption { - type = attrsOf link; - default = { }; + submodule ( + { name, ... }: + { + options = { + name = mkOption { + type = with types; nullOr str; + default = name; + }; + module = mkOption { + type = deferredModule; + }; + examples = mkOption { + type = attrsOf (nullOr example); + default = { }; + }; + extensions = mkOption { + type = attrsOf (nullOr plugin); + default = { }; + }; + links = mkOption { + type = attrsOf link; + default = { }; + }; }; - }; - }; + } + ); # TODO: make use of modular services https://github.com/NixOS/nixpkgs/pull/372170 service =