Be more specific on Darwin
This commit is contained in:
+10
-7
@@ -3,16 +3,19 @@
|
||||
pkgs.writeShellScriptBin "hms" ''
|
||||
set -eo pipefail
|
||||
# Build different targets with GUI or not
|
||||
if [ -z "$DISPLAY" ]; then
|
||||
target="nogui"
|
||||
else
|
||||
target="gui"
|
||||
fi
|
||||
|
||||
arch="$(uname -m)"
|
||||
if [ "$(uname -s)" == "Darwin" ]; then
|
||||
# On macOS
|
||||
src="$HOME/.config/nix/"
|
||||
target=gui
|
||||
target="''${arch}-darwin"
|
||||
else
|
||||
# On Linux/WSL2 systems
|
||||
if [ -z "$DISPLAY" ]; then
|
||||
target="''${arch}-nogui"
|
||||
else
|
||||
target="''${arch}-gui"
|
||||
fi
|
||||
src=/etc/nixos
|
||||
fi
|
||||
|
||||
@@ -20,7 +23,7 @@ fi
|
||||
echo "Building $(uname -m)-$target"
|
||||
dest=$(mktemp -d)
|
||||
pushd "$dest" > /dev/null
|
||||
nix build --impure "$src#homeConfigurations.$(uname -m)-$target.activationPackage"
|
||||
nix build --impure "$src#homeConfigurations.$target.activationPackage"
|
||||
./result/activate
|
||||
popd > /dev/null
|
||||
rm -r "$dest"
|
||||
|
||||
Reference in New Issue
Block a user