From 04b7ba3a33bded61429bf18f0513983c5ab08eb3 Mon Sep 17 00:00:00 2001 From: pennae Date: Sun, 1 Oct 2023 18:41:26 +0200 Subject: add *some* documentation --- openwrt/etc.nix | 38 +++++++++++++++++++++++++------------- 1 file changed, 25 insertions(+), 13 deletions(-) (limited to 'openwrt/etc.nix') diff --git a/openwrt/etc.nix b/openwrt/etc.nix index 8231125..b9f8324 100644 --- a/openwrt/etc.nix +++ b/openwrt/etc.nix @@ -6,21 +6,33 @@ in { options.etc = lib.mkOption { - type = lib.types.attrsOf (lib.types.submodule ({ name, ... }: { - options = { - enable = lib.mkEnableOption "this `/etc` file" // { - default = true; - }; + type = lib.types.attrsOf (lib.types.submoduleWith { + description = "`/etc` file description"; + modules = [ + ({ name, ... }: { + options = { + enable = lib.mkEnableOption "this `/etc` file" // { + default = true; + }; - text = lib.mkOption { - type = lib.types.lines; - description = '' - Contents of the file. - ''; - }; - }; - })); + text = lib.mkOption { + type = lib.types.lines; + description = '' + Contents of the file. + ''; + }; + }; + }) + ]; + }); default = {}; + description = '' + Extra files to *create* in the target `/etc`. It is not currently possible to + *delete* files from the target. + + This option should usually not be used if there's a UCI way to achieve the + same effect. + ''; }; config = lib.mkIf (cfg != {}) { -- cgit v1.2.3