Configure git credential.helper=store system-wide

Prevents git from trying to open /dev/tty for password prompts in
environments without a controlling terminal (live ISO, scripts, Claude Code).
Credentials stored once in ~/.git-credentials and reused automatically.

Applied to: both live ISO include overlays and the installer target system.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
moze
2026-04-25 13:01:15 +00:00
parent 49d94bd2ac
commit 106fa940d7
3 changed files with 18 additions and 0 deletions

View File

@@ -88,6 +88,12 @@ EOF
fi
chmod 440 "$TARGET/etc/sudoers.d/10-wheel"
# git: use file-based credential store so push/pull never tries to open /dev/tty
cat > "$TARGET/etc/gitconfig" <<'EOF'
[credential]
helper = store
EOF
ok "user '$USERNAME' created and added to: $USER_GROUPS"
}

View File

@@ -653,6 +653,12 @@ EOF
install -d -m 0755 "$INCLUDE_DIR/etc/skel/.config/nixpkgs"
echo '{ allowUnfree = true; }' > "$INCLUDE_DIR/etc/skel/.config/nixpkgs/config.nix"
# git: use file-based credential store so push/pull never tries to open /dev/tty
cat > "$INCLUDE_DIR/etc/gitconfig" <<'EOF'
[credential]
helper = store
EOF
# ── 3g) Skel: .bash_profile sources .bashrc only (no first-login autorun) ──
install -d -m 0755 "$INCLUDE_DIR/etc/skel"
cat > "$INCLUDE_DIR/etc/skel/.bash_profile" <<'EOF'

View File

@@ -264,6 +264,12 @@ EOF
install -d -m 0755 "$INCLUDE_DIR/etc/skel/.config/nixpkgs"
echo '{ allowUnfree = true; }' > "$INCLUDE_DIR/etc/skel/.config/nixpkgs/config.nix"
# git: use file-based credential store so push/pull never tries to open /dev/tty
cat > "$INCLUDE_DIR/etc/gitconfig" <<'EOF'
[credential]
helper = store
EOF
# ── 3e) niri config.kdl in /etc/skel ───────────────────────────────────
# dracut's adduser.sh copies skel → /home/live, so the live user gets a
# ready niri config without any first-boot setup step.