From da01b7e5ace3cf7f47151e9a65b6758c91fb9037 Mon Sep 17 00:00:00 2001 From: Pierre Kisters <1524059+lhns@users.noreply.github.com> Date: Thu, 1 Oct 2026 17:56:58 +0200 Subject: [PATCH] install.sh: install --clone [--dir] [--ref] Clones your own config repository (git@host:owner/repo, https://..., github:owner/repo) into ~/nix-config or --dir and installs it like --flake . An existing clone of the same repository (any URL form) is reused and, after asking, pulled with --ff-only; another repository, a non-clone or a different branch is refused. A failed clone hints at SSH URLs and gh auth login. Uses SteamOS' git, else Nix's. Checked against local bare repositories through a logging git. --- README.md | 17 +++++++- docs/development.md | 3 +- install.sh | 87 +++++++++++++++++++++++++++++++++++++-- modules/cleanup/check.nix | 87 ++++++++++++++++++++++++++++++++++++++- 4 files changed, 186 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 66e63e7..209b3aa 100644 --- a/README.md +++ b/README.md @@ -91,6 +91,17 @@ with "Restart once": reboot once. Re-running it just switches again (`--yes` answers every question). Afterwards edit `~/nix-config/home.nix` and switch (see [Usage](#usage)). +Your own config in a git repository: `--clone ` clones it into +`~/nix-config` (`--dir `, branch `--ref `) and installs it like +`--flake `; an existing clone of the same repository is reused (after +asking, `git pull --ff-only`). URLs: `git@github.com:owner/repo`, +`https://...` or `github:owner/repo`; a private repository needs an SSH URL +with your key or HTTPS credentials (e.g. `gh auth login`). + +```sh +curl -fsSL https://steam-frame-nix.lhns.de | bash -s -- install --clone git@github.com:owner/my-config +``` + ```sh curl -fsSL https://steam-frame-nix.lhns.de | bash -s -- status # Nix, generation, services curl -fsSL https://steam-frame-nix.lhns.de | bash -s -- uninstall # --keep-nix keeps Nix @@ -440,8 +451,10 @@ versions left: [docs/cleanup.md](docs/cleanup.md). if Nix was already there without flakes; - `~/nix-config` (your configuration, a git repository, from the template with your user name filled into `flake.nix`) and the link - `~/.config/home-manager` to it, unless that exists or `--flake` is given; - uninstall removes the link, never the configuration; + `~/.config/home-manager` to it, unless that exists or `--flake` is given + (with `--flake ` or `--clone`, the link to that directory unless it + exists); uninstall removes the link, never the configuration (a clone + included); - dotfiles in Home Manager's way, renamed to `*.hm-backup-