Update for IVR Linux

This commit is contained in:
Greg Hellings
2023-11-01 14:19:31 -05:00
parent fb244ca7cc
commit 145c6e30fb
7 changed files with 42 additions and 96 deletions
+4 -26
View File
@@ -2,35 +2,13 @@
set -eo pipefail
# Build different targets with GUI or not
arch="$(uname -m)"
if [ "$(uname -s)" == "Darwin" ]; then
# On macOS
src="${HOME}/.config/darwin/"
flavor="gui"
if [ "${arch}" == "arm64" ]; then
arch=aarch64
fi
arch="${arch}-darwin"
elif [ x"${WSL_DISTRO_NAME}" != "x" ]; then
src=/etc/nixos
flavor="cli"
arch="${arch}-linux"
else
# On Linux systems
if [ -z "${DISPLAY}" ]; then
flavor="cli"
else
flavor="gdm"
fi
src=/etc/nixos
arch="${arch}-linux"
fi
# Build and switch
echo "Building ${flavor}.${arch}"
user="$(whoami)"
src="${HOME}/.config/nix"
echo "Building ${user}"
dest=$(mktemp -d)
pushd "${dest}" > /dev/null
nix build "${src}#homeConfigurations.${flavor}.${arch}.activationPackage"
nix build "${src}#homeConfigurations.\"${user}\".activationPackage"
./result/activate
popd > /dev/null
rm -r "${dest}"
+2 -2
View File
@@ -1,3 +1,3 @@
{ pkgs, ... }:
{ pkgs, gh, ... }:
pkgs.writeShellScriptBin "setup-ssh" (builtins.readFile ./setup-ssh.sh)
pkgs.writeShellScriptBin "setup-ssh" (builtins.replaceStrings ["gh "] ["${gh}/bin/gh "] (builtins.readFile ./setup-ssh.sh))