Update ffmac and HMS
Externalize the hms shell script for easier editing Update ffmac to latest release Add copying of Mac apps to the expected folder
This commit is contained in:
+1
-28
@@ -1,30 +1,3 @@
|
||||
{ pkgs, ... }:
|
||||
|
||||
pkgs.writeShellScriptBin "hms" ''
|
||||
set -eo pipefail
|
||||
# Build different targets with GUI or not
|
||||
|
||||
arch="$(uname -m)"
|
||||
if [ "$(uname -s)" == "Darwin" ]; then
|
||||
# On macOS
|
||||
src="$HOME/.config/nix/"
|
||||
target="''${arch}-darwin"
|
||||
else
|
||||
# On Linux/WSL2 systems
|
||||
if [ -z "$DISPLAY" ]; then
|
||||
target="''${arch}-nogui"
|
||||
else
|
||||
target="''${arch}-gui"
|
||||
fi
|
||||
src=/etc/nixos
|
||||
fi
|
||||
|
||||
# Build and switch
|
||||
echo "Building $target"
|
||||
dest=$(mktemp -d)
|
||||
pushd "$dest" > /dev/null
|
||||
nix build --impure "$src#homeConfigurations.$target.activationPackage"
|
||||
./result/activate
|
||||
popd > /dev/null
|
||||
rm -r "$dest"
|
||||
''
|
||||
pkgs.writeShellScriptBin "hms" (builtins.readFile ./hms.sh)
|
||||
|
||||
Reference in New Issue
Block a user