forked from mirrors/nixpkgs
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}'";
|
mkShellStr = val: "'${replaceStrings ["'"] ["'\\''"] val}'";
|
||||||
|
|
||||||
nixos-taskdctl = import ./helper-tool.nix {
|
nixos-taskserver = import ./helper-tool.nix {
|
||||||
inherit pkgs lib mkShellStr taskd;
|
inherit pkgs lib mkShellStr taskd;
|
||||||
config = cfg;
|
config = cfg;
|
||||||
};
|
};
|
||||||
|
|
||||||
ctlcmd = "${nixos-taskdctl}/bin/nixos-taskdctl --service-helper";
|
ctlcmd = "${nixos-taskserver}/bin/nixos-taskserver --service-helper";
|
||||||
|
|
||||||
in {
|
in {
|
||||||
|
|
||||||
|
@ -303,7 +303,7 @@ in {
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
|
|
||||||
environment.systemPackages = [ pkgs.taskserver nixos-taskdctl ];
|
environment.systemPackages = [ pkgs.taskserver nixos-taskserver ];
|
||||||
|
|
||||||
users.users = optional (cfg.user == "taskd") {
|
users.users = optional (cfg.user == "taskd") {
|
||||||
name = "taskd";
|
name = "taskd";
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
{ config, pkgs, lib, mkShellStr, taskd }:
|
{ config, pkgs, lib, mkShellStr, taskd }:
|
||||||
|
|
||||||
let
|
let
|
||||||
|
commandName = "nixos-taskserver";
|
||||||
mkShellName = lib.replaceStrings ["-"] ["_"];
|
mkShellName = lib.replaceStrings ["-"] ["_"];
|
||||||
|
|
||||||
genClientKey = ''
|
genClientKey = ''
|
||||||
|
@ -51,7 +52,7 @@ let
|
||||||
}
|
}
|
||||||
|
|
||||||
usage_${mkShellName name}() {
|
usage_${mkShellName name}() {
|
||||||
echo " nixos-taskdctl ${name} ${usagePosArgs}" >&2
|
echo " ${commandName} ${name} ${usagePosArgs}" >&2
|
||||||
${lib.concatMapStringsSep "\n " mkDesc description}
|
${lib.concatMapStringsSep "\n " mkDesc description}
|
||||||
}
|
}
|
||||||
'';
|
'';
|
||||||
|
@ -265,7 +266,7 @@ let
|
||||||
subcmd "${name}" ${cmdArgs};;
|
subcmd "${name}" ${cmdArgs};;
|
||||||
'';
|
'';
|
||||||
|
|
||||||
in pkgs.writeScriptBin "nixos-taskdctl" ''
|
in pkgs.writeScriptBin commandName ''
|
||||||
#!${pkgs.stdenv.shell}
|
#!${pkgs.stdenv.shell}
|
||||||
export TASKDDATA=${mkShellStr config.dataDir}
|
export TASKDDATA=${mkShellStr config.dataDir}
|
||||||
|
|
||||||
|
@ -311,7 +312,7 @@ in pkgs.writeScriptBin "nixos-taskdctl" ''
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
${lib.concatStrings (lib.mapAttrsToList mkCase subcommands)}
|
${lib.concatStrings (lib.mapAttrsToList mkCase subcommands)}
|
||||||
*) echo "Usage: nixos-taskdctl <subcommand> [<args>]" >&2
|
*) echo "Usage: ${commandName} <subcommand> [<args>]" >&2
|
||||||
echo >&2
|
echo >&2
|
||||||
echo "A tool to manage taskserver users on NixOS" >&2
|
echo "A tool to manage taskserver users on NixOS" >&2
|
||||||
echo >&2
|
echo >&2
|
||||||
|
|
|
@ -50,7 +50,7 @@ import ./make-test.nix {
|
||||||
);
|
);
|
||||||
|
|
||||||
my $exportinfo = $server->succeed(
|
my $exportinfo = $server->succeed(
|
||||||
"nixos-taskdctl export-user $org $user"
|
"nixos-taskserver export-user $org $user"
|
||||||
);
|
);
|
||||||
|
|
||||||
$exportinfo =~ s/'/'\\'''/g;
|
$exportinfo =~ s/'/'\\'''/g;
|
||||||
|
@ -70,9 +70,9 @@ import ./make-test.nix {
|
||||||
$server->waitForUnit("taskserver.service");
|
$server->waitForUnit("taskserver.service");
|
||||||
|
|
||||||
$server->succeed(
|
$server->succeed(
|
||||||
"nixos-taskdctl list-users testOrganisation | grep -qxF alice",
|
"nixos-taskserver list-users testOrganisation | grep -qxF alice",
|
||||||
"nixos-taskdctl list-users testOrganisation | grep -qxF foo",
|
"nixos-taskserver list-users testOrganisation | grep -qxF foo",
|
||||||
"nixos-taskdctl list-users anotherOrganisation | grep -qxF bob"
|
"nixos-taskserver list-users anotherOrganisation | grep -qxF bob"
|
||||||
);
|
);
|
||||||
|
|
||||||
$server->waitForOpenPort(${portStr});
|
$server->waitForOpenPort(${portStr});
|
||||||
|
|
Loading…
Reference in a new issue