-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·46 lines (31 loc) · 1.35 KB
/
install.sh
File metadata and controls
executable file
·46 lines (31 loc) · 1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/usr/bin/bash
set -eEuo pipefail
if [[ -z "$GITHUB_TOKEN" ]]; then
echo "Error: Set GITHUB_TOKEN env var"
exit 1
fi
export DOTFILES_DIR DOTFILES_CACHE DOTFILES_EXTRA_DIR
DOTFILES_DIR="$HOME/.dotfiles"
# Package managers & pagkages
. "$DOTFILES_DIR/install/packages.sh"
# install nix
curl -fsSL https://install.determinate.systems/nix | sh -s -- install
export PATH="/nix/var/nix/profiles/default/bin:$PATH"
. /home/johnmaguire/.nix-profile/etc/profile.d/nix.sh
nix-channel --add https://nixos.org/channels/nixpkgs-unstable
nix-channel --add https://github.com/nix-community/home-manager/archive/master.tar.gz home-manager
nix-channel --update
nix-shell '<home-manager>' -A install
# remove some stuff we're going to put back on our own
rm -r "$HOME/.config/home-manager"
ln -sfv "$DOTFILES_DIR/.config/home-manager" "$HOME/.config"
# sudo ln -s ~/.nix-profile/share/wayland-sessions/sway.desktop /usr/share/wayland-sessions/sway-hm.desktop
home-manager switch -b backup --extra-experimental-features nix-command --extra-experimental-features flakes --flake ~/.config/home-manager#"$USER"
fc-cache -fv
echo "NEW KEY IS $NEWKEY"
if [ -n "$NEWKEY" ]; then
. "$DOTFILES_DIR/install/autokey-github.sh"
fi
mise install
echo "GITHUB_ACCESS_TOKEN=$GITHUB_TOKEN" >"$DOTFILES_DIR/system/.private_env"
echo "GITHUB_TOKEN=$GITHUB_TOKEN" >"$DOTFILES_DIR/system/.private_env"