-
Notifications
You must be signed in to change notification settings - Fork 0
/
install
executable file
·42 lines (39 loc) · 1.08 KB
/
install
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
#!/bin/bash
# Detect architecture
architecture=""
case "$(uname -s)" in
Linux)
case "$(uname -m)" in
x86_64) architecture="x86_64-linux" ;;
aarch64) architecture="aarch64-linux" ;;
i686) architecture="i686-linux" ;;
*) echo "ERROR: Unsupported architecture" && exit 1 ;;
esac
;;
Darwin)
case "$(uname -m)" in
x86_64) architecture="x86_64-darwin" ;;
arm64) architecture="aarch64-darwin" ;;
*) echo "ERROR: Unsupported architecture" && exit 1 ;;
esac
;;
*)
echo "ERROR: Unsupported operating system" && exit 1
;;
esac
echo "## System Info: $architecture"
# Run home-manager
if command -v home-manager >/dev/null; then
home-manager switch \
-b backup \
--impure \
--extra-experimental-features "nix-command flakes" \
--flake ~/dotfiles#simifa-"${architecture}"
else
nix --extra-experimental-features "nix-command flakes" run \
home-manager/release-24.05 switch -- \
-b backup \
--impure \
--extra-experimental-features "nix-command flakes" \
--flake ~/dotfiles#simifa-"${architecture}"
fi