-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathactivate.sh
More file actions
executable file
·45 lines (34 loc) · 1.18 KB
/
Copy pathactivate.sh
File metadata and controls
executable file
·45 lines (34 loc) · 1.18 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
#!/bin/bash
# home-manager activation script
export PATH="$HOME/.nix-profile/bin:$PATH"
CHEZNIX="$HOME/.config/home-manager"
# the following commands will be echoed
set -x
cd "$HOME" || exit 1
chezmoi init --ssh bryango/chezmoi --branch dev
# ensure that `home-attrs` is cached
nix eval --raw cheznix#cheznix.inputs.home-attrs.outPath | cachix push chezbryan &
# chores
# verify downstream overrides of upstream files
if [[ $HOSTNAME == memoriam ]]; then
! git diff --color=always --no-index \
{/run/current-system/sw/share/zsh/5.9/functions,~/.zsh_profiles/completions}/_networksetup
fi
# the following commands will be silent
set +x
# note that $hmConfigRef is exported from ./modules/home-setup.nix
# shellcheck disable=2154
profile_hash=$(echo "$hmConfigRef" | sha1sum | head -c 5)
nix profile list --json | jq > "$CHEZNIX/profile-${profile_hash}.json"
>&2 echo
>&2 printf "## installing git hooks ... "
pushd "$CHEZNIX/.git/hooks" &>/dev/null || exit 1
ln -sf ../../pre-commit pre-commit
popd &>/dev/null || exit 1
>&2 echo "completed."
if [[ $OSTYPE == linux* ]];
then >&2 cat <<- EOF
## to activate system config:
sudo system-manager switch --flake "${FLAKE_CONFIG_URI%#*}"
EOF
fi