summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--modules/continuum.nix11
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 =