Uses fish argparse for update-sys fn.

This commit is contained in:
Bailey 2024-02-19 01:16:05 -05:00
parent 47cbe29f37
commit 9eef6693a5

View file

@ -241,8 +241,21 @@ in
set -l last_argv $argv
echo \"$argv[1]\" Command Not Found
'';
update-hm = "home-manager switch -L --flake nixconf &| nom";
update-sys = "sudo nixos-rebuild switch --log-format internal-json -v --flake nixconf &| nom --json";
update-sys = ''
argparse -i 'f/flake=' -- $argv
set -f mode switch
if set -q argv[1]
set -f mode $argv[1]
end
set -f flake nixconf
if set -q _flag_f
set -f flake $_flag_f
end
sudo echo -n # Make sure sudo has already prompted for password.
sudo nixos-rebuild $mode --log-format internal-json -v --flake $flake &| nom --json
'';
};
interactiveShellInit = ''
abbr --position anywhere -a !! -f last_cmd