From aad1c347d1d0da1c52bb30d19edbee77218c4fe8 Mon Sep 17 00:00:00 2001 From: RTUnreal Date: Wed, 9 Apr 2025 12:43:29 +0200 Subject: [PATCH] clanModules: fix shellcheck errors --- clanModules/data-mesher/shared.nix | 8 ++++---- clanModules/garage/default.nix | 6 +++--- clanModules/sshd/roles/server.nix | 6 +++--- clanModules/sshd/shared.nix | 2 +- clanModules/state-version/roles/default.nix | 2 +- clanModules/syncthing-static-peers/default.nix | 10 +++++----- clanModules/user-password/roles/default.nix | 10 +++++----- 7 files changed, 22 insertions(+), 22 deletions(-) diff --git a/clanModules/data-mesher/shared.nix b/clanModules/data-mesher/shared.nix index 49f43f6fe..bfeea2989 100644 --- a/clanModules/data-mesher/shared.nix +++ b/clanModules/data-mesher/shared.nix @@ -117,8 +117,8 @@ in script = '' data-mesher generate keypair \ - --public-key-path $out/public_key \ - --private-key-path $out/private_key + --public-key-path "$out"/public_key \ + --private-key-path "$out"/private_key ''; }; @@ -146,8 +146,8 @@ in script = '' data-mesher generate keypair \ - --public-key-path $out/public_key \ - --private-key-path $out/private_key + --public-key-path "$out"/public_key \ + --private-key-path "$out"/private_key ''; }; }; diff --git a/clanModules/garage/default.nix b/clanModules/garage/default.nix index bf3b45d3b..0d2afa903 100644 --- a/clanModules/garage/default.nix +++ b/clanModules/garage/default.nix @@ -22,8 +22,8 @@ pkgs.openssl ]; script = '' - openssl rand -base64 -out $out/admin_token 32 - openssl rand -base64 -out $out/metrics_token 32 + openssl rand -base64 -out "$out"/admin_token 32 + openssl rand -base64 -out "$out"/metrics_token 32 ''; }; @@ -35,7 +35,7 @@ pkgs.openssl ]; script = '' - openssl rand -hex -out $out/rpc_secret 32 + openssl rand -hex -out "$out"/rpc_secret 32 ''; }; diff --git a/clanModules/sshd/roles/server.nix b/clanModules/sshd/roles/server.nix index f23123cb3..435eefcd3 100644 --- a/clanModules/sshd/roles/server.nix +++ b/clanModules/sshd/roles/server.nix @@ -47,7 +47,7 @@ in pkgs.openssh ]; script = '' - ssh-keygen -t ed25519 -N "" -f $out/ssh.id_ed25519 + ssh-keygen -t ed25519 -N "" -f "$out"/ssh.id_ed25519 ''; }; @@ -67,7 +67,7 @@ in pkgs.openssh ]; script = '' - ssh-keygen -t rsa -b 4096 -N "" -f $out/ssh.id_rsa + ssh-keygen -t rsa -b 4096 -N "" -f "$out"/ssh.id_rsa ''; }; @@ -92,7 +92,7 @@ in -h \ -n ${lib.concatMapStringsSep "," (d: "${config.clan.core.settings.machine.name}.${d}") domains} \ $in/openssh/ssh.id_ed25519.pub - mv $in/openssh/ssh.id_ed25519-cert.pub $out/ssh.id_ed25519-cert.pub + mv $in/openssh/ssh.id_ed25519-cert.pub "$out"/ssh.id_ed25519-cert.pub ''; }; }; diff --git a/clanModules/sshd/shared.nix b/clanModules/sshd/shared.nix index 713ae1c7f..298b6f9ab 100644 --- a/clanModules/sshd/shared.nix +++ b/clanModules/sshd/shared.nix @@ -36,7 +36,7 @@ pkgs.openssh ]; script = '' - ssh-keygen -t ed25519 -N "" -f $out/id_ed25519 + ssh-keygen -t ed25519 -N "" -f "$out"/id_ed25519 ''; }; diff --git a/clanModules/state-version/roles/default.nix b/clanModules/state-version/roles/default.nix index 05424077d..03d81a233 100644 --- a/clanModules/state-version/roles/default.nix +++ b/clanModules/state-version/roles/default.nix @@ -12,7 +12,7 @@ in }; runtimeInputs = [ ]; script = '' - echo -n ${lib.versions.majorMinor config.system.stateVersion} > $out/version + echo -n ${lib.versions.majorMinor config.system.stateVersion} > "$out"/version ''; }; } diff --git a/clanModules/syncthing-static-peers/default.nix b/clanModules/syncthing-static-peers/default.nix index 2b10e0237..6b853d6af 100644 --- a/clanModules/syncthing-static-peers/default.nix +++ b/clanModules/syncthing-static-peers/default.nix @@ -99,11 +99,11 @@ in pkgs.syncthing ]; script = '' - syncthing generate --config $out - mv $out/key.pem $out/key - mv $out/cert.pem $out/cert - cat $out/config.xml | grep -oP '(?<= $out/id - cat $out/config.xml | grep -oP '\K[^<]+' | uniq > $out/api + syncthing generate --config "$out" + mv "$out"/key.pem "$out"/key + mv "$out"/cert.pem "$out"/cert + cat "$out"/config.xml | grep -oP '(?<= "$out"/id + cat "$out"/config.xml | grep -oP '\K[^<]+' | uniq > "$out"/api ''; }; } diff --git a/clanModules/user-password/roles/default.nix b/clanModules/user-password/roles/default.nix index 54424bb2f..9d469cc09 100644 --- a/clanModules/user-password/roles/default.nix +++ b/clanModules/user-password/roles/default.nix @@ -44,13 +44,13 @@ in pkgs.mkpasswd ]; script = '' - prompt_value=$(cat $prompts/user-password) - if [[ -n ''${prompt_value-} ]]; then - echo $prompt_value | tr -d "\n" > $out/user-password + prompt_value=$(cat "$prompts"/user-password) + if [[ -n "''${prompt_value-}" ]]; then + echo "$prompt_value" | tr -d "\n" > "$out"/user-password else - xkcdpass --numwords 3 --delimiter - --count 1 | tr -d "\n" > $out/user-password + xkcdpass --numwords 3 --delimiter - --count 1 | tr -d "\n" > "$out"/user-password fi - mkpasswd -s -m sha-512 < $out/user-password | tr -d "\n" > $out/user-password-hash + mkpasswd -s -m sha-512 < "$out"/user-password | tr -d "\n" > "$out"/user-password-hash ''; }; };