added warning for flakeLocation being null instead of an assert
This commit is contained in:
@@ -33,7 +33,7 @@
|
||||
zsh = let
|
||||
flakeLocation = builtins.getEnv "PWD";
|
||||
in
|
||||
assert flakeLocation != "";
|
||||
lib.warnIf (flakeLocation == "") "Flake Location is undefined. Are you building in the right directory?"
|
||||
inputs.wrappers.wrappers.zsh.wrap {
|
||||
inherit pkgs;
|
||||
runtimePkgs = [pkgs.carapace pkgs.devenv pkgs.fzf];
|
||||
@@ -44,8 +44,14 @@
|
||||
lg = lib.getExe pkgs.lazygit;
|
||||
man = "man -P \"${lib.getExe pkgs.bat} -p\"";
|
||||
nsh = "nix-shell -p";
|
||||
nrs = "( cd ${flakeLocation} && sudo nixos-rebuild switch --impure --flake . )";
|
||||
vinix = "nvim --cmd 'cd ${flakeLocation}'";
|
||||
nrs =
|
||||
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 = ''
|
||||
source ${./devenv.zsh}
|
||||
|
||||
Reference in New Issue
Block a user