diff options
| author | tv <tv@krebsco.de> | 2026-11-19 18:54:50 +0000 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-11-19 18:54:50 +0000 |
| commit | 94eeadb91d7e37c0304bcf3f2d7c7748371d3d1f (patch) | |
| tree | edf29ea4c550cc86586a356614a5c822bb2db942 /modules | |
| parent | a9dee76c4b6cd7bfefa7a6055804aab8b870220b (diff) | |
continuum: add user
An instance runs as a dynamic user unless it names one.
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/continuum.nix | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/modules/continuum.nix b/modules/continuum.nix index 4a30b0e..4d8c063 100644 --- a/modules/continuum.nix +++ b/modules/continuum.nix @@ -38,6 +38,14 @@ in { example = { htpasswd = "/var/src/secrets/continuum.htpasswd"; }; type = lib.types.attrsOf mylib.types.absolute-pathname; }; + options.user = lib.mkOption { + default = null; + description = '' + The user the instance runs as. By default one of its own, which + exists only while it runs (DynamicUser). + ''; + type = lib.types.nullOr lib.types.str; + }; options.settings = lib.mkOption { default = {}; description = '' @@ -80,7 +88,8 @@ in { Restart = "always"; RestartSec = "5s"; - DynamicUser = true; + DynamicUser = instance.user == null; + User = lib.mkIf (instance.user != null) instance.user; StateDirectory = "continuum-${name}"; StateDirectoryMode = "0700"; LoadCredential = |
