-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsh
More file actions
executable file
·24 lines (19 loc) · 855 Bytes
/
sh
File metadata and controls
executable file
·24 lines (19 loc) · 855 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/bash
set -eux -o pipefail
# bash <(curl https://github.com/iff/dotfiles/master/sh)
install_nix() {
curl -L https://nixos.org/nix/install | sh
mkdir -p $HOME/.config/nix/
echo "extra-experimental-features = nix-command flakes" >> $HOME/.config/nix/nix.conf
}
which nix || install_nix
mkdir -p $HOME/.ssh
hostname=$(hostname)
[ ! -f $HOME/.ssh/${hostname} ] && ssh-keygen -t ed25519 -C "iff@yvesineichen.com" -f $HOME/.ssh/${hostname} -N ''
echo "IdentityFile $HOME/.ssh/${hostname}" >> $HOME/.ssh/config
# TODO does this persist to non-nix shell?
# https://cli.github.com/manual/gh_auth_login
# https://cli.github.com/manual/gh_repo_clone
nix-shell -p gh --command gh auth login --hostname GitHub.com
git clone git@github.com:iff/dotfiles.git $HOME/.dotfiles
cd $HOME/.dotfiles && nix run . switch -- --flake .#${hostname}