fix: add set -euo pipefail and boot ordering to password-setup services

Agent-Logs-Url: https://github.com/naturallaw777/staging_alpha/sessions/2f9c39e8-d673-4314-bff7-28f1fffd48a0

Co-authored-by: naturallaw777 <99053422+naturallaw777@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-04-30 00:52:17 +00:00
committed by GitHub
parent 7da0463dce
commit 6512bf4356
+4
View File
@@ -127,6 +127,7 @@ in
}; };
path = [ pkgs.shadow pkgs.coreutils ]; path = [ pkgs.shadow pkgs.coreutils ];
script = '' script = ''
set -euo pipefail
SECRET_FILE="/var/lib/secrets/root-password" SECRET_FILE="/var/lib/secrets/root-password"
if [ ! -f "$SECRET_FILE" ]; then if [ ! -f "$SECRET_FILE" ]; then
mkdir -p /var/lib/secrets mkdir -p /var/lib/secrets
@@ -158,12 +159,15 @@ in
systemd.services.free-password-setup = { systemd.services.free-password-setup = {
description = "Generate and set a random 'free' user password"; description = "Generate and set a random 'free' user password";
wantedBy = [ "multi-user.target" ]; wantedBy = [ "multi-user.target" ];
before = [ "display-manager.service" ];
after = [ "systemd-user-sessions.service" ];
serviceConfig = { serviceConfig = {
Type = "oneshot"; Type = "oneshot";
RemainAfterExit = true; RemainAfterExit = true;
}; };
path = [ pkgs.shadow pkgs.coreutils ]; path = [ pkgs.shadow pkgs.coreutils ];
script = '' script = ''
set -euo pipefail
SECRET_FILE="/var/lib/secrets/free-password" SECRET_FILE="/var/lib/secrets/free-password"
PENDING_FILE="/var/lib/secrets/free-password-migration-pending" PENDING_FILE="/var/lib/secrets/free-password-migration-pending"