-
-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathjustfile
More file actions
66 lines (54 loc) · 1.44 KB
/
Copy pathjustfile
File metadata and controls
66 lines (54 loc) · 1.44 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
58
59
60
61
62
63
64
65
default:
@just --list
# update all flake inputs flake.lock
update-flake-inputs:
#!/usr/bin/env bash
set -euxo pipefail
nix flake update
if git diff --exit-code flake.lock > /dev/null 2>&1; then
echo "no changes to flake.lock"
else
echo "committing flake.lock"
git add flake.lock
git commit -m "chore(nix): update flake.lock"
fi
# update one input in flake.lock
update-flake-input input:
#!/usr/bin/env bash
set -euxo pipefail
nix flake update {{ input }}
if git diff --exit-code flake.lock > /dev/null 2>&1; then
echo "no changes to flake.lock"
else
echo "committing flake.lock"
git add flake.lock
git commit -m "chore(nix): update {{ input }} flake.lock"
fi
# run home-manager switch
hm:
home-manager switch --flake ~/.dotfiles -b backup
# rebuild nix darwin
[macos]
rebuild:
sudo darwin-rebuild switch --flake ~/.dotfiles
# rebuild nixos
[linux]
rebuild:
sudo nixos-rebuild switch --flake ~/.dotfiles
# update and upgrade homebrew packages
[macos]
update-brew:
brew update && brew upgrade
# fix shell files. this happens sometimes with nix-darwin
[macos]
fix-shell-files:
#!/usr/bin/env bash
set -euxo pipefail
sudo mv /etc/zshenv /etc/zshenv.before-nix-darwin
sudo mv /etc/zshrc /etc/zshrc.before-nix-darwin
sudo mv /etc/bashrc /etc/bashrc.before-nix-darwin
# updates brew, darwin, and runs home-manager
[macos]
update: update-brew hm rebuild
news:
home-manager news --flake .