Skip to content

Commit

Permalink
Make flake git repo configurable in the setup script
Browse files Browse the repository at this point in the history
  • Loading branch information
rake5k committed Sep 22, 2023
1 parent a038eea commit cc17e5c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ After rebooting proceed with the [next section](#nixos-config-setup).
#### NixOS config setup
```bash
$ sudo nix run github:rake5k/nixcfg#setup
$ sudo nix run github:rake5k/nixcfg#setup -- [email protected]:rake5k/nixcfg.git
```
### Non-NixOS
Expand All @@ -171,7 +171,7 @@ sh <(curl -L https://nixos.org/nix/install) --no-channel-add --no-modify-profile
```bash
# Set up this Nix configuration
nix run github:rake5k/nixcfg#setup
nix run github:rake5k/nixcfg#setup -- [email protected]:rake5k/nixcfg.git
# set login shell
chsh -s /bin/zsh
Expand Down
8 changes: 7 additions & 1 deletion lib/apps/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ source @bashLib@

export -f _log

### Gather flake info

readonly FLAKE_GIT_REPO="${1}"

nix_config="@flakePath@"
export nix_config

Expand All @@ -27,8 +31,9 @@ _clone() {
}

# clone repos
# shellcheck disable=SC2310
if ! _is_nixos || _is_root; then
_clone "nix-config" [email protected]:rake5k/nixcfg.git "${nix_config}"
_clone "nix-config" "${FLAKE_GIT_REPO}" "${nix_config}"
fi

# generage age key
Expand Down Expand Up @@ -93,6 +98,7 @@ _setup_nix() {
fi
}

# shellcheck disable=SC2310
if _is_nixos && _is_root; then
_setup_nixos
elif ! _is_nixos && ! _is_root; then
Expand Down

0 comments on commit cc17e5c

Please sign in to comment.