flk script: add home-manager only configuration support

This commit is contained in:
Pacman99 2021-01-16 10:28:20 -08:00 committed by Timothy DeHerrera
parent 88eecddab5
commit bbcf4123b2
No known key found for this signature in database
GPG key ID: 8985725DB5B0C122

View file

@ -12,7 +12,7 @@ let
flk = pkgs.writeShellScriptBin "flk" ''
if [[ -z "$1" ]]; then
echo "Usage: $(basename "$0") [ iso | up | install {host} | {host} [switch|boot|test] ]"
echo "Usage: $(basename "$0") [ iso | up | install {host} | {host} [switch|boot|test] | home {host} {user} [switch] ]"
elif [[ "$1" == "up" ]]; then
mkdir -p $DEVSHELL_ROOT/up
hostname=$(hostname)
@ -27,6 +27,11 @@ let
nix build $DEVSHELL_ROOT#nixosConfigurations.niximg.${build}.isoImage "${"\${@:2}"}"
elif [[ "$1" == "install" ]]; then
sudo nixos-install --flake "$DEVSHELL_ROOT#$2" "${"\${@:3}"}"
elif [[ "$1" == "home" ]]; then
nix build ./#hmActivationPackages.$2.$3
if [[ "$4" == "switch" ]]; then
./result/activate && unlink result
fi
else
sudo nixos-rebuild --flake "$DEVSHELL_ROOT#$1" "${"\${@:2}"}"
fi