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