install --clone: clone with the template's credential helpers

The template now enables git (SteamOS's own, package = null; Home
Manager writes its config) with the GitHub CLI's credential helper for
github.com and `store` (~/.git-credentials) for other hosts.

Without a Home Manager configuration, `install --clone` first creates
and activates the template in the target directory, then clones next to
it with git's helpers and GIT_TERMINAL_PROMPT=0 (never a password
prompt). If that fails with a terminal, it offers `gh auth login` and
retries once; otherwise the template stays active and the message says
how to continue. After the clone the template is removed, the clone
takes its place and Home Manager switches to it.

Only a missing (or empty) target or the untouched template is cloned
into: create_config marks its configuration with the hash of its files
in .git/steam-frame-nix-template. Anything else there is used as it is,
so a rerun continues where a run stopped (after a failed switch it just
switches); Nix and the template switch (helpers present) are skipped
when already done. The origin comparison and the pull are gone.
This commit is contained in:
Pierre Kisters committed 2026-10-01 23:25:10 +02:00
1 parent 269321ea92
commit 6f163141f5
3 files changed
+307 -85

No files matched your search

+11
View File
@@ -9,6 +9,17 @@
targets.genericLinux.enable = true; # non-NixOS integration
programs.home-manager.enable = true; # the `home-manager` command
# git credentials for HTTPS (`install.sh install --clone` uses them):
# GitHub through the GitHub CLI (log in once: gh auth login, works with
# 2FA), other hosts from ~/.git-credentials. git itself is SteamOS's;
# Home Manager only writes its config. Remove to manage git yourself.
programs.git = {
enable = true;
package = null;
settings.credential.helper = "store";
};
programs.gh.enable = true;
# Packages for your user, e.g.:
# home.packages = with pkgs; [ htop ripgrep ];