-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjustfile
More file actions
57 lines (45 loc) · 2.06 KB
/
justfile
File metadata and controls
57 lines (45 loc) · 2.06 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
47
48
49
50
51
52
53
54
55
56
57
install TARGET-IP HOST:
# Run disko and install nixos
nix run github:numtide/nixos-anywhere -- \
--build-on remote \
--phases kexec,disko,install \
--generate-hardware-config nixos-generate-config ./hosts/{{ HOST }}/hardware.nix \
--flake '.#{{ HOST }}' \
root@{{ TARGET-IP }}
# Copy ssh keys over
ssh teevik@{{ TARGET-IP }} "mkdir -p /mnt/home/teevik/.ssh"
scp /home/teevik/.ssh/id_rsa teevik@{{ TARGET-IP }}:/mnt/home/teevik/.ssh/id_rsa
scp /home/teevik/.ssh/id_rsa.pub teevik@{{ TARGET-IP }}:/mnt/home/teevik/.ssh/id_rsa.pub
# Copy sops age key for secret decryption
ssh teevik@{{ TARGET-IP }} "mkdir -p /mnt/home/teevik/.config/sops/age"
scp /home/teevik/.config/sops/age/keys.txt teevik@{{ TARGET-IP }}:/mnt/home/teevik/.config/sops/age/keys.txt
# Clone config repo
ssh teevik@{{ TARGET-IP }} "mkdir /mnt/home/teevik/Documents"
ssh teevik@{{ TARGET-IP }} "git clone https://github.com/teevik/Config.git /mnt/home/teevik/Documents/Config"
ssh teevik@{{ TARGET-IP }} "cd /mnt/home/teevik/Documents/Config && git remote set-url origin git@github.com:teevik/Config.git"
# Stow dotfiles
ssh teevik@{{ TARGET-IP }} "cd /mnt/home/teevik/Documents/Config && stow -t /mnt/home/teevik dotfiles"
# Reboot
# ssh root@{{ TARGET-IP }} "reboot"
# Stow dotfiles into home directory
stow:
stow -v -t ~ dotfiles
# Remove stowed dotfiles
unstow:
stow -v -t ~ -D dotfiles
# Re-stow dotfiles (useful after adding new files)
restow:
stow -v -t ~ -R dotfiles
# First-time stow: adopt existing files, then check diff
stow-adopt:
stow -v -t ~ --adopt dotfiles
@echo "Files adopted. Run 'git diff dotfiles/' to review changes."
# Create required directories
setup:
mkdir -p ~/.npm-packages/lib
mkdir -p ~/Documents ~/Downloads ~/Music ~/Pictures/Screenshots ~/Videos ~/Desktop ~/Public ~/Templates
update:
nix run nixpkgs#nix-update -- --flake opencode --build
# , nix-update --flake oh-my-pi --build
build-iso:
nix run "nixpkgs#nixos-generators" -- --format iso --flake ".#minimal"