refactor(steamcmd): constrain service names
This commit was merged in pull request #187.
This commit is contained in:
@@ -15,9 +15,9 @@
|
||||
};
|
||||
|
||||
serviceName = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
type = lib.types.strMatching "[a-z0-9][a-z0-9-]*";
|
||||
example = "valheim";
|
||||
description = "Name of the systemd service that runs the game server.";
|
||||
description = "Lowercase systemd service basename for the game server.";
|
||||
};
|
||||
|
||||
appId = lib.mkOption {
|
||||
@@ -87,7 +87,7 @@
|
||||
prepareScript = pkgs.writeShellScript "steamcmd-${service.serviceName}-prepare" ''
|
||||
set -eu
|
||||
|
||||
${pkgs.coreutils}/bin/install -d \
|
||||
${lib.getExe' pkgs.coreutils "install"} -d \
|
||||
-o ${user} \
|
||||
-g ${group} \
|
||||
-m 0770 \
|
||||
@@ -155,7 +155,7 @@
|
||||
wantedBy = lib.mkIf service.autoStart [ "multi-user.target" ];
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
ExecStart = "${pkgs.systemd}/bin/systemctl --no-block start ${service.serviceName}.service";
|
||||
ExecStart = "${lib.getExe' pkgs.systemd "systemctl"} --no-block start ${service.serviceName}.service";
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user