nixos/taskserver: Rename nixos-taskdctl
Using nixos-taskserver is more verbose but less cryptic and I think it fits the purpose better because it can't be confused to be a wrapper around the taskdctl command from the upstream project as nixos-taskserver shares no commonalities with it. Signed-off-by: aszlig <aszlig@redmoonstudios.org>
This commit is contained in:
parent
78925e4a90
commit
2d89617052
|
@ -81,12 +81,12 @@ let
|
|||
|
||||
mkShellStr = val: "'${replaceStrings ["'"] ["'\\''"] val}'";
|
||||
|
||||
nixos-taskdctl = import ./helper-tool.nix {
|
||||
nixos-taskserver = import ./helper-tool.nix {
|
||||
inherit pkgs lib mkShellStr taskd;
|
||||
config = cfg;
|
||||
};
|
||||
|
||||
ctlcmd = "${nixos-taskdctl}/bin/nixos-taskdctl --service-helper";
|
||||
ctlcmd = "${nixos-taskserver}/bin/nixos-taskserver --service-helper";
|
||||
|
||||
in {
|
||||
|
||||
|
@ -303,7 +303,7 @@ in {
|
|||
|
||||
config = mkIf cfg.enable {
|
||||
|
||||
environment.systemPackages = [ pkgs.taskserver nixos-taskdctl ];
|
||||
environment.systemPackages = [ pkgs.taskserver nixos-taskserver ];
|
||||
|
||||
users.users = optional (cfg.user == "taskd") {
|
||||
name = "taskd";
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
{ config, pkgs, lib, mkShellStr, taskd }:
|
||||
|
||||
let
|
||||
commandName = "nixos-taskserver";
|
||||
mkShellName = lib.replaceStrings ["-"] ["_"];
|
||||
|
||||
genClientKey = ''
|
||||
|
@ -51,7 +52,7 @@ let
|
|||
}
|
||||
|
||||
usage_${mkShellName name}() {
|
||||
echo " nixos-taskdctl ${name} ${usagePosArgs}" >&2
|
||||
echo " ${commandName} ${name} ${usagePosArgs}" >&2
|
||||
${lib.concatMapStringsSep "\n " mkDesc description}
|
||||
}
|
||||
'';
|
||||
|
@ -265,7 +266,7 @@ let
|
|||
subcmd "${name}" ${cmdArgs};;
|
||||
'';
|
||||
|
||||
in pkgs.writeScriptBin "nixos-taskdctl" ''
|
||||
in pkgs.writeScriptBin commandName ''
|
||||
#!${pkgs.stdenv.shell}
|
||||
export TASKDDATA=${mkShellStr config.dataDir}
|
||||
|
||||
|
@ -311,7 +312,7 @@ in pkgs.writeScriptBin "nixos-taskdctl" ''
|
|||
|
||||
case "$1" in
|
||||
${lib.concatStrings (lib.mapAttrsToList mkCase subcommands)}
|
||||
*) echo "Usage: nixos-taskdctl <subcommand> [<args>]" >&2
|
||||
*) echo "Usage: ${commandName} <subcommand> [<args>]" >&2
|
||||
echo >&2
|
||||
echo "A tool to manage taskserver users on NixOS" >&2
|
||||
echo >&2
|
||||
|
|
|
@ -50,7 +50,7 @@ import ./make-test.nix {
|
|||
);
|
||||
|
||||
my $exportinfo = $server->succeed(
|
||||
"nixos-taskdctl export-user $org $user"
|
||||
"nixos-taskserver export-user $org $user"
|
||||
);
|
||||
|
||||
$exportinfo =~ s/'/'\\'''/g;
|
||||
|
@ -70,9 +70,9 @@ import ./make-test.nix {
|
|||
$server->waitForUnit("taskserver.service");
|
||||
|
||||
$server->succeed(
|
||||
"nixos-taskdctl list-users testOrganisation | grep -qxF alice",
|
||||
"nixos-taskdctl list-users testOrganisation | grep -qxF foo",
|
||||
"nixos-taskdctl list-users anotherOrganisation | grep -qxF bob"
|
||||
"nixos-taskserver list-users testOrganisation | grep -qxF alice",
|
||||
"nixos-taskserver list-users testOrganisation | grep -qxF foo",
|
||||
"nixos-taskserver list-users anotherOrganisation | grep -qxF bob"
|
||||
);
|
||||
|
||||
$server->waitForOpenPort(${portStr});
|
||||
|
|
Loading…
Reference in a new issue