19
overlays/customscripts/src/hm-switch
Executable file
19
overlays/customscripts/src/hm-switch
Executable file
@@ -0,0 +1,19 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
flakeDir=$HM_CONF_DIR;
|
||||
if [ -z "$HM_CONF_DIR" ]; then
|
||||
echo "HM_CONF_DIR is unset, using current directory as the flake directory"
|
||||
flakeDir=.
|
||||
fi
|
||||
|
||||
echo "You're about to switch your home-manager configuration as '$USER'"
|
||||
read -p "Continue (y/n)?" conf
|
||||
|
||||
if [[ ${conf,,} =~ ^(y|yes)$ ]]; then
|
||||
nix build "$flakeDir"\#hm-configs.$USER.activationPackage -o hm-result &&
|
||||
./hm-result/activate
|
||||
unlink hm-result
|
||||
else
|
||||
echo "If this is not you, then log into your profile first!"
|
||||
exit 1
|
||||
fi
|
Reference in New Issue
Block a user