reaktor2: add user option
This commit is contained in:
parent
aa070d5db7
commit
6271cfaed4
@ -25,7 +25,7 @@ with import <stockholm/lib>;
|
||||
type = types.listOf types.attrs;
|
||||
};
|
||||
stateDir = mkOption {
|
||||
default = "/var/lib/${self.config.systemd-service-name}";
|
||||
default = "/var/lib/${self.config.user}";
|
||||
readOnly = true;
|
||||
type = types.absolute-pathname;
|
||||
};
|
||||
@ -33,6 +33,10 @@ with import <stockholm/lib>;
|
||||
default = "reaktor2${optionalString (name != "default") "-${name}"}";
|
||||
type = types.filename;
|
||||
};
|
||||
user = mkOption {
|
||||
default = self.config.systemd-service-name;
|
||||
type = types.str;
|
||||
};
|
||||
};
|
||||
}));
|
||||
};
|
||||
@ -43,10 +47,10 @@ with import <stockholm/lib>;
|
||||
after = [ "network.target" ];
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
serviceConfig = {
|
||||
User = cfg.systemd-service-name;
|
||||
User = cfg.user;
|
||||
Group = "reaktor2";
|
||||
DynamicUser = true;
|
||||
StateDirectory = cfg.systemd-service-name;
|
||||
StateDirectory = cfg.user;
|
||||
ExecStart = let
|
||||
configFile = pkgs.writeJSON configFileName configValue;
|
||||
configFileName = "${cfg.systemd-service-name}.config.json";
|
||||
|
Loading…
Reference in New Issue
Block a user