Nix : Rename update functions.

This commit is contained in:
Dmitry Voronin 2024-01-31 03:32:45 +03:00
parent 312d0810a9
commit 31c34f3292
3 changed files with 25 additions and 31 deletions

View file

@ -34,7 +34,19 @@ function nix_channel() {
nix-channel --list
}
# Update system (rebuild).
# Rebuild system.
# Optionally force the hostname.
# Usage: nix_rebuild [HOSTNAME]
function nix_rebuild() {
local target="${1}"
[[ "${target}" = "" ]] && target="${HOSTNAME}"
cd ${HOME}/.config/linux/system
nixos-rebuild switch --flake .#${target}
cd -
}
# Update system.
# Optionally force the hostname.
# Usage: nix_update [HOSTNAME]
function nix_update() {
@ -42,18 +54,8 @@ function nix_update() {
[[ "${target}" = "" ]] && target="${HOSTNAME}"
cd ${HOME}/.config/linux/system
nixos-rebuild switch --flake .#${target}
}
# Upgrade system. Applies after reboot.
# Optionally force the hostname.
# Usage: nix_upgrade [HOSTNAME]
function nix_upgrade() {
local target="${1}"
[[ "${target}" = "" ]] && target="${HOSTNAME}"
cd ${HOME}/.config/linux/system
nix flake update && nix_update "${target}"
nix flake update
cd -
}
# Free up root space.

View file

@ -14,7 +14,7 @@
networking.extraHosts = ''
10.1.0.2 git.voronind.com
'';
networking.nameservers = [ "1.1.1.1" "8.8.8.8" ];
networking.networkmanager.insertNameservers = [ "1.1.1.1" "8.8.8.8" ];
# Filesystems.
fileSystems."/storage/cold_1" = {

View file

@ -94,11 +94,10 @@ Command|Description
Command|Description
---|---
`cp <FROM> <TO>`|Replaces default cp with rsync.
`cp_merge <FROM> <TO>`|Copy and also merge all changes (delete dst files that do not exist in src).
`rcp <FROM> <TO>`|Replaces default cp with rsync.
`rcp_merge <FROM> <TO>`|Copy and also merge all changes (delete dst files that do not exist in src).
`cp_link <FROM> <TO>`|Copy by creating hardlinks. Works for directories, too.
`bcp`|Default cp, a.k.a builtin cp. When you don't need rsync.
`cp_test <FROM> <TO>`|Print output of cp_merge without writing anything.
`rcp_test <FROM> <TO>`|Print output of cp_merge without writing anything.
## Date.
@ -118,8 +117,8 @@ Command|Description
Command|Description
---|---
`df`|Show only physical drives info.
`du [DIRS]`|Show combined size in SI. Current dir by default.
`pdf`|Show only physical drives info.
`tdu [DIRS]`|Show total size in SI. Current dir by default.
## Docker.
@ -262,22 +261,15 @@ Command|Description
`name_replace <OLD> <NEW> [FILES]`|Replace part of the name. All matching files by default.
`name_fix_numbering [FILES]`|Fix numbering for numbered files. I.e if there are 10 items and some of them start without zero, then append zero to it. 1..10 -> 01..10.
## Ncdu.
Command|Description
---|---
`ncdu [DIRS]`|Search only on current filesystem. Current dir by default.
## Nix.
Command|Description
---|---
`nix_find <PACKAGE>`|Find Nix package path.
`nix_unstable`|Switch to Unstable branch.
`nix_unstable_small`|Switch to Small Unstable branch (for server).
`nix_channel`|Display current channel.
`nix_update [HOSTNAME]`|Update system (rebuild). Optionally force the hostname.
`nix_upgrade [HOSTNAME]`|Upgrade system. Applies after reboot. Optionally force the hostname.
`nix_rebuild [HOSTNAME]`|Rebuild system. Optionally force the hostname.
`nix_update [HOSTNAME]`|Update system. Optionally force the hostname.
`nix_clean`|Free up root space.
`nix_shell [NAME]`|Spawn shell with specified nix environment. `Main` is default.
`nix_tmpshell <PACKAGES>`|Spawn nix-shell with specified packages.
@ -321,11 +313,11 @@ Command|Description
`parse_startcase <STRING>`|Parse string to start case.
`parse_json <STRING>`|Parse string to pretty Json.
## Permissions.
## Permission.
Command|Description
---|---
`perm_share`|Recursively change permissions to allow read sharing with group and others.
`perm_share`|Recursively change permissions to allow read sharing with group and others.
`perm`|Recursively change permissions to restrict access for group and others.
## Ps.