mirror of
https://codeberg.org/mtxyz/nixconf.git
synced 2024-11-09 10:01:57 +00:00
Uses fish argparse for update-sys fn.
This commit is contained in:
parent
47cbe29f37
commit
9eef6693a5
1 changed files with 15 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue