clanModules: fix shellcheck errors

This commit is contained in:
RTUnreal
2025-04-09 12:43:29 +02:00
committed by Qubasa
parent 37a627f8bc
commit 3f4ff94af6
7 changed files with 22 additions and 22 deletions

View File

@@ -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
'';
};
};

View File

@@ -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
'';
};

View File

@@ -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
'';
};
};

View File

@@ -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
'';
};

View File

@@ -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
'';
};
}

View File

@@ -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 '(?<=<device id=")[^"]+' | uniq > $out/id
cat $out/config.xml | grep -oP '<apikey>\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 '(?<=<device id=")[^"]+' | uniq > "$out"/id
cat "$out"/config.xml | grep -oP '<apikey>\K[^<]+' | uniq > "$out"/api
'';
};
}

View File

@@ -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
'';
};
};