tangled
alpha
login
or
join now
ngp.computer
/
nixos
0
fork
atom
Configuration for my NixOS based systems and Home Manager
0
fork
atom
overview
issues
pulls
pipelines
Add update-nix script
ngp.computer
1 month ago
9f4ba735
0dc16c73
+27
1 changed file
expand all
collapse all
unified
split
scripts
update-nix.rcsh
+27
scripts/update-nix.rcsh
reviewed
···
1
1
+
#!/usr/bin/env rc
2
2
+
3
3
+
nix_dir=()
4
4
+
system_type=()
5
5
+
if (test -d ~/repos/nixos) {
6
6
+
nix_dir=~/repos/nixos
7
7
+
system_type=nixos
8
8
+
echo On a NixOS based system
9
9
+
}
10
10
+
if (test -d ~/.config/home-manager) {
11
11
+
nix_dir=~/.config/home-manager
12
12
+
system_type=homemanager
13
13
+
echo On a Home Manager based system
14
14
+
}
15
15
+
echo Using $nix_dir
16
16
+
17
17
+
nix flake update --flake $nix_dir
18
18
+
19
19
+
switch($system_type) {
20
20
+
case nixos
21
21
+
exec sudo nixos-rebuild --refresh --show-trace --flake $nix_dir
22
22
+
case homemanager
23
23
+
exec sudo home-manager switch --refresh --flake $nix_dir
24
24
+
case *
25
25
+
echo Huh? Unexpected system type: $system_type
26
26
+
exit 1
27
27
+
}