mirror of
https://github.com/alyraffauf/nixcfg.git
synced 2024-11-22 07:13:55 -05:00
hoenn: take flake as argument
This commit is contained in:
parent
3ecdcd5ff6
commit
a516c23fb0
|
@ -5,18 +5,16 @@
|
|||
...
|
||||
}: let
|
||||
hoenn = pkgs.writeShellScriptBin "hoenn" ''
|
||||
FLAKE=''${FLAKE:-"github:alyraffauf/nixcfg"}
|
||||
FLAKE=''${2:-"github:alyraffauf/nixcfg"}
|
||||
HOST=''${HOST:-${config.networking.hostName}}
|
||||
GIT=''${GIT:-"https://github.com/alyraffauf/nixcfg.git"}
|
||||
GIT=https://''${FLAKE//:/\.com\/}.git
|
||||
|
||||
if [ "$1" = "sync" ]; then
|
||||
if [ "$2" == "" ] || [ "$2" == "now" ]; then
|
||||
sudo ${pkgs.nixos-rebuild}/bin/nixos-rebuild switch --flake $FLAKE#$HOST
|
||||
exit 0;
|
||||
elif [ "$2" == "boot" ]; then
|
||||
bin/sudo ${pkgs.nixos-rebuild}/bin/nixos-rebuild boot --flake $FLAKE#$HOST
|
||||
exit 0;
|
||||
fi
|
||||
if [ "$1" == "sync" ]; then
|
||||
sudo ${pkgs.nixos-rebuild}/bin/nixos-rebuild switch --flake $FLAKE#$HOST
|
||||
exit 0;
|
||||
elif [ "$1" == "boot" ]; then
|
||||
bin/sudo ${pkgs.nixos-rebuild}/bin/nixos-rebuild boot --flake $FLAKE#$HOST
|
||||
exit 0;
|
||||
elif [ "$1" == "gc" ]; then
|
||||
sudo ${pkgs.nix}/bin/nix-collect-garbage -d
|
||||
exit 0;
|
||||
|
|
Loading…
Reference in a new issue