Files
nixos/overlays/hms.nix
T
Greg Hellings 78704b5c88 Convert home-manager to flakes
Instead of calling the home manager directly in the user's list, we add
a command for the user to invoke "hms" and have their environment setup
in the way that Greg likes.
2022-08-02 01:50:50 -05:00

21 lines
413 B
Nix

{ pkgs, ... }:
pkgs.writeShellScriptBin "hms" ''
set -eo pipefail
# Build different targets with GUI or not
if [ -z "$DISPLAY" ]; then
target="nogui"
else
target="gui"
fi
# Build and switch
echo "Building $(uname -m)-$target"
dest=$(mktemp -d)
pushd "$dest" > /dev/null
nix build --impure /etc/nixos#homeConfigurations.$(uname -m)-$target.activationPackage
./result/activate
popd > /dev/null
rm -r "$dest"
''