added warning for flakeLocation being null instead of an assert

This commit is contained in:
2026-07-29 17:26:14 +01:00
parent 3a634375a0
commit 5f7fc8ea05

View File

@@ -33,7 +33,7 @@
zsh = let zsh = let
flakeLocation = builtins.getEnv "PWD"; flakeLocation = builtins.getEnv "PWD";
in in
assert flakeLocation != ""; lib.warnIf (flakeLocation == "") "Flake Location is undefined. Are you building in the right directory?"
inputs.wrappers.wrappers.zsh.wrap { inputs.wrappers.wrappers.zsh.wrap {
inherit pkgs; inherit pkgs;
runtimePkgs = [pkgs.carapace pkgs.devenv pkgs.fzf]; runtimePkgs = [pkgs.carapace pkgs.devenv pkgs.fzf];
@@ -44,8 +44,14 @@
lg = lib.getExe pkgs.lazygit; lg = lib.getExe pkgs.lazygit;
man = "man -P \"${lib.getExe pkgs.bat} -p\""; man = "man -P \"${lib.getExe pkgs.bat} -p\"";
nsh = "nix-shell -p"; nsh = "nix-shell -p";
nrs = "( cd ${flakeLocation} && sudo nixos-rebuild switch --impure --flake . )"; nrs =
vinix = "nvim --cmd 'cd ${flakeLocation}'"; if flakeLocation != ""
then "( cd ${flakeLocation} && sudo nixos-rebuild switch --impure --flake . )"
else "echo 'Flake location not specified. Did you build with --impure?'";
vinix =
if flakeLocation != ""
then "nvim --cmd 'cd ${flakeLocation}'"
else "echo 'Flake location not specified. Did you build with --impure?'";
}; };
zshrc.content = '' zshrc.content = ''
source ${./devenv.zsh} source ${./devenv.zsh}