-
Notifications
You must be signed in to change notification settings - Fork 0
/
build
executable file
·66 lines (55 loc) · 1.51 KB
/
build
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
66
#! /usr/bin/env bash
# Shows the output of every command
set +x
pre_home() {
echo "Creating config / cache directories..."
# Polybar logs
mkdir -p $HOME/.config/polybar/logs
touch $HOME/.config/polybar/logs/bottom.log
touch $HOME/.config/polybar/logs/top.log
# FZF cache
mkdir -p $HOME/.cache/fzf-hoogle
touch $HOME/.cache/fzf-hoogle/cache.json
# Desktop pic
mkdir -p $HOME/Pictures/
cp imgs/nixos.png $HOME/Pictures/
}
post_home() {
# Set user's profile picture for Gnome3
echo "Setting profile picture for the accounts service"
sudo cp imgs/gvolpe.png /var/lib/AccountsService/icons/gvolpe
sudo echo "Icon=/var/lib/AccountsService/icons/gvolpe" >> /var/lib/AccountsService/users/gvolpe
# Set screenlock wallpaper
echo "Setting screen-lock wallpaper"
multilockscreen -u imgs/nixos.png
}
build_ci_home() {
nix build .#homeConfigurations.gvolpe-edp.activationPackage
}
build_ci_system() {
nix build .#nixosConfigurations.dell-xps.config.system.build.toplevel
nix build .#nixosConfigurations.tongfang-amd.config.system.build.toplevel
}
fresh_install() {
nix-shell -p cachix --command '
cachix use gvolpe-nixos
./switch system
./build pre-home
./switch home
./build post-home
'
}
case $1 in
"ci-home")
build_ci_home;;
"ci-system")
build_ci_system;;
"fresh-install")
fresh_install;;
"pre-home")
pre_home;;
"post-home")
post_home;;
*)
echo "Invalid option. Expected 'ci-home', 'ci-system', 'pre_home', 'post_home' or 'fresh-install'";;
esac