Devolve home-manager separately
This commit is contained in:
+31
-6
@@ -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}"
|
||||
|
||||
Reference in New Issue
Block a user