diff options
| author | Ophestra <cat@gensokyo.uk> | 2025-05-16 04:38:08 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2025-05-16 04:40:12 +0900 |
| commit | f30a439bcd6aa97fac0f99cdd94381ae025aa64d (patch) | |
| tree | 9e340298cc0b8a7011fea40cc50b0db710593496 /options.nix | |
| parent | 008e9e7fc59398c13376728511f2df78e4c8b321 (diff) | |
nix: improve common usability
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'options.nix')
| -rw-r--r-- | options.nix | 62 |
1 files changed, 52 insertions, 10 deletions
diff --git a/options.nix b/options.nix index 8af00c5e..c8747f2d 100644 --- a/options.nix +++ b/options.nix @@ -3,6 +3,38 @@ packages: let inherit (lib) types mkOption mkEnableOption; + + mountPoint = + let + inherit (types) + str + submodule + nullOr + listOf + ; + in + listOf (submodule { + options = { + dst = mkOption { + type = nullOr str; + default = null; + description = '' + Mount point in container, same as src if null. + ''; + }; + + src = mkOption { + type = str; + description = '' + Host filesystem path to make available to the container. + ''; + }; + + write = mkEnableOption "mounting path as writable"; + dev = mkEnableOption "use of device files"; + require = mkEnableOption "start failure if the bind mount cannot be established for any reason"; + }; + }); in { @@ -33,14 +65,10 @@ in ''; }; - home-manager = mkOption { - type = - let - inherit (types) functionTo attrsOf anything; - in - functionTo (functionTo (attrsOf anything)); + extraHomeConfig = mkOption { + type = types.anything; description = '' - Target user shared home-manager configuration. + Extra home-manager configuration to merge with all target users. ''; }; @@ -189,11 +217,15 @@ in ''; }; + useCommonPaths = mkEnableOption "common extra paths" // { + default = true; + }; + extraPaths = mkOption { - type = listOf anything; + type = mountPoint; default = [ ]; description = '' - Extra paths to make available to the sandbox. + Extra paths to make available to the container. ''; }; @@ -242,7 +274,17 @@ in }; }); default = [ ]; - description = "Declarative fortify apps."; + description = '' + Declaratively configured fortify apps. + ''; + }; + + commonPaths = mkOption { + type = mountPoint; + default = [ ]; + description = '' + Common extra paths to make available to the container. + ''; }; stateDir = mkOption { |
