Devolve home-manager separately

This commit is contained in:
Greg Hellings
2025-06-10 14:56:59 -05:00
parent eecd6e6d5d
commit f93908c43f
4 changed files with 37 additions and 8 deletions
+31 -6
View File
@@ -1,13 +1,38 @@
# vim: set ft=bash:
# Build different targets with GUI or not
set -ex -o pipefail
# Build and switch
user="$(whoami)"
src="${HOME}/.config/nix"
echo "Building ${user}"
system="$(uname -s)"
# Determine where the Flake is
if [ "$system" == "Darwin" ]; then
try_src="/etc/nix-darwin"
else
try_src="/etc/nixos"
fi
if [ -d "$try_src" ]; then
src="$try_src"
target="$(hostname)"
else
src="$HOME/.config/nix"
target="$(whoami)"
fi
# Find the hostname
echo "Building user for ${target}"
# Build the system
dest=$(mktemp -d)
trap cleanup 1 2 3 6 15
function cleanup {
echo "Cleaning up"
rm -r "${dest}"
exit
}
pushd "${dest}" > /dev/null
nom build "${src}#homeConfigurations.\"${user}\".activationPackage"
nom build "${src}#homeConfigurations.\"${target}\".activationPackage"
./result/activate
popd > /dev/null
rm -r "${dest}"