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:
greg-compass
2022-11-10 11:15:49 -06:00
parent d1344fa2bd
commit f0a50305b8
3 changed files with 38 additions and 31 deletions
Generated
+3 -3
View File
@@ -44,11 +44,11 @@
"nixpkgs": "nixpkgs_2"
},
"locked": {
"lastModified": 1667351381,
"narHash": "sha256-7bnKheuYsY2zyNluA22vHQu9R3YB0ArxTUFd57oWAo4=",
"lastModified": 1667610227,
"narHash": "sha256-2olA2HYnz07rjDq3lMqCmDRlSegp1WL4OqR3KSy3Hy4=",
"owner": "bandithedoge",
"repo": "nixpkgs-firefox-darwin",
"rev": "e777625df67530c7f67649d28a9bbc676d5e2d44",
"rev": "78d9f25b7816f5711f80093721cf6618cda3e1c0",
"type": "github"
},
"original": {
+1 -28
View File
@@ -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)
+34
View File
@@ -0,0 +1,34 @@
# vim: set ft=bash:
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}"
if [ "$(uname -s)" == "Darwin" ]; then
for app in ~/.nix-profile/Applications/*.app; do
echo "Copying '${app}' to Applications"
cp -r "${app}" "${HOME}/Applications"
done
fi