From 2d8961705249a9a144e2f7d944e04fd938b4a2c9 Mon Sep 17 00:00:00 2001 From: aszlig Date: Tue, 5 Apr 2016 18:40:15 +0200 Subject: [PATCH] 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 --- nixos/modules/services/misc/taskserver/default.nix | 6 +++--- nixos/modules/services/misc/taskserver/helper-tool.nix | 7 ++++--- nixos/tests/taskserver.nix | 8 ++++---- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/nixos/modules/services/misc/taskserver/default.nix b/nixos/modules/services/misc/taskserver/default.nix index 4a33ddd9d246..793cc2aa36bb 100644 --- a/nixos/modules/services/misc/taskserver/default.nix +++ b/nixos/modules/services/misc/taskserver/default.nix @@ -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"; diff --git a/nixos/modules/services/misc/taskserver/helper-tool.nix b/nixos/modules/services/misc/taskserver/helper-tool.nix index 90ac85948164..70660574d04c 100644 --- a/nixos/modules/services/misc/taskserver/helper-tool.nix +++ b/nixos/modules/services/misc/taskserver/helper-tool.nix @@ -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 []" >&2 + *) echo "Usage: ${commandName} []" >&2 echo >&2 echo "A tool to manage taskserver users on NixOS" >&2 echo >&2 diff --git a/nixos/tests/taskserver.nix b/nixos/tests/taskserver.nix index 927dcbd9b28b..61f2b06a7f74 100644 --- a/nixos/tests/taskserver.nix +++ b/nixos/tests/taskserver.nix @@ -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});