reaktor2 service: user -> username + proper type

This commit is contained in:
tv 2019-01-27 20:06:06 +01:00
parent fa1e5d5b7f
commit 52ef20148e
2 changed files with 7 additions and 7 deletions

View File

@ -146,7 +146,7 @@ in {
}
systemPlugin
];
user = "reaktor2";
username = "reaktor2";
};
r = {
nick = "reaktor2|krebs";
@ -162,7 +162,7 @@ in {
}
systemPlugin
];
user = "reaktor2";
username = "reaktor2";
};
};
}

View File

@ -25,7 +25,7 @@ with import <stockholm/lib>;
type = types.listOf types.attrs;
};
stateDir = mkOption {
default = "/var/lib/${self.config.user}";
default = "/var/lib/${self.config.username}";
readOnly = true;
type = types.absolute-pathname;
};
@ -33,9 +33,9 @@ with import <stockholm/lib>;
default = "reaktor2${optionalString (name != "default") "-${name}"}";
type = types.filename;
};
user = mkOption {
username = mkOption {
default = self.config.systemd-service-name;
type = types.str;
type = types.username;
};
useTLS = mkOption {
default = self.config.port == "6697";
@ -51,10 +51,10 @@ with import <stockholm/lib>;
after = [ "network.target" ];
wantedBy = [ "multi-user.target" ];
serviceConfig = {
User = cfg.user;
User = cfg.username;
Group = "reaktor2";
DynamicUser = true;
StateDirectory = cfg.user;
StateDirectory = cfg.username;
ExecStart = let
configFile = pkgs.writeJSON configFileName configValue;
configFileName = "${cfg.systemd-service-name}.config.json";