Nix : Add nixdroid_switch.

This commit is contained in:
Dmitry Voronin 2024-03-01 19:16:00 +03:00
parent 5c0678c739
commit ad07cf3ea6
3 changed files with 25 additions and 11 deletions

View file

@ -7,13 +7,3 @@ function ask() {
}" 2> /dev/null | parallel -j1 -- "echo {} | jq -r .response | tr -d '\n'"
echo
}
# Ask code AI.
# Usage: ask_code <QUERY>
function ask_code() {
curl http://localhost:11434/api/generate -d "{
\"model\": \"mistral\",
\"prompt\":\"${*}\"
}" 2> /dev/null | parallel -j1 -- "echo {} | jq -r .response | tr -d '\n'"
echo
}

View file

@ -69,6 +69,11 @@ function nix_live() {
nix build "${_nix_system_config}#nixosConfigurations.live.config.system.build.isoImage"
}
# Switch nix-on-droid.
function nixdroid_switch() {
nix-on-droid switch --flake .config/linux/system
}
# Autocomplete with available hosts.
function _comp_hosts() {
local IFS=$'\n'

View file

@ -31,6 +31,13 @@ Command|Description
`unarchive [FILES]`|Extract previously created archive with checksum validation.
`archive_touch [FILES]`|Change archive's filesystem time to match creation date.
## Ask.
Command|Description
---|---
`ask <QUERY>`|Ask general AI.
`ask_code <QUERY>`|Ask code AI.
## Battery.
Command|Description
@ -219,7 +226,7 @@ Command|Description
`gr [COMMIT COUNT]`|Rebase by X commits or from root. When COUNT is 0 - rebase from root. Default is 2.
`gu [EMAIL]`|Specify git user as Dmitry Voronin with provided email.
`gg <REPO>`|Get my git repo.
`gdc <COMMITHASH>`|See diff for a specific commit.
`gdc [COMMITHASH]`|See diff for a specific commit. Last commit by default.
`gv`| Get version number based on commit count.
## Group.
@ -355,6 +362,18 @@ Command|Description
`recursive <COMMAND>`|Run something recursively over all directories.
`recursive1 <COMMAND>`|Run something recursively over directories of 1 depth (excluding current dir).
## Save.
Command|Description
---|---
`save [TARGETS]`|Backup a game save.
## Ssh.
Command|Description
---|---
`sshmount <REMOTE> <LOCAL>`|Mount FS over ssh. Just extra config for sshfs.
## Su.
Command|Description