summaryrefslogtreecommitdiff
path: root/modules/system
diff options
context:
space:
mode:
authorMichael Hoang <enzime@users.noreply.github.com>2024-10-29 00:09:37 +1100
committerMichael Hoang <enzime@users.noreply.github.com>2024-11-07 17:20:00 +1100
commit041996803af5497fb000e3f79621fa5bb6995057 (patch)
treeb4191887150dd1080ddd96f58ef4a66e08800cc1 /modules/system
parent9afef9950f28780ff24908496c36f27826a601cf (diff)
treewide: fix shellcheck warnings and errors
Diffstat (limited to 'modules/system')
-rw-r--r--modules/system/checks.nix8
1 files changed, 5 insertions, 3 deletions
diff --git a/modules/system/checks.nix b/modules/system/checks.nix
index 6d7ccc0..ec6e3b5 100644
--- a/modules/system/checks.nix
+++ b/modules/system/checks.nix
@@ -88,7 +88,7 @@ let
buildUsers = ''
buildUser=$(dscl . -read /Groups/nixbld GroupMembership 2>&1 | awk '/^GroupMembership: / {print $2}') || true
- if [ -z $buildUser ]; then
+ if [[ -z "$buildUser" ]]; then
echo "error: Using the nix-daemon requires build users, aborting activation" >&2
echo "Create the build users or disable the daemon:" >&2
echo "$ darwin-install" >&2
@@ -104,7 +104,7 @@ let
buildGroupID = ''
buildGroupID=$(dscl . -read /Groups/nixbld PrimaryGroupID | awk '{print $2}')
expectedBuildGroupID=${toString config.ids.gids.nixbld}
- if [[ $buildGroupID != $expectedBuildGroupID ]]; then
+ if [[ $buildGroupID != "$expectedBuildGroupID" ]]; then
printf >&2 '\e[1;31merror: Build user group has mismatching GID, aborting activation\e[0m\n'
printf >&2 'The default Nix build user group ID was changed from 30000 to 350.\n'
printf >&2 'You are currently managing Nix build users with nix-darwin, but your\n'
@@ -114,6 +114,7 @@ let
printf >&2 'Possible causes include setting up a new Nix installation with an\n'
printf >&2 'existing nix-darwin configuration, setting up a new nix-darwin\n'
printf >&2 'installation with an existing Nix installation, or manually increasing\n'
+ # shellcheck disable=SC2016
printf >&2 'your `system.stateVersion` setting.\n'
printf >&2 '\n'
printf >&2 'You can set the configured group ID to match the actual value:\n'
@@ -266,6 +267,7 @@ let
if [[ -d /etc/ssh/authorized_keys.d ]]; then
printf >&2 '\e[1;31merror: /etc/ssh/authorized_keys.d exists, aborting activation\e[0m\n'
printf >&2 'SECURITY NOTICE: The previous implementation of the\n'
+ # shellcheck disable=SC2016
printf >&2 '`users.users.<name>.openssh.authorizedKeys.*` options would not delete\n'
printf >&2 'authorized keys files when the setting for a given user was removed.\n'
printf >&2 '\n'
@@ -334,7 +336,7 @@ in
system.activationScripts.checks.text = ''
${cfg.text}
- if test ''${checkActivation:-0} -eq 1; then
+ if [[ "''${checkActivation:-0}" -eq 1 ]]; then
echo "ok" >&2
exit 0
fi