From 380641c7eff807456604508f58d5315e2e5ecb42 Mon Sep 17 00:00:00 2001 From: Dmitry Voronin Date: Thu, 21 Mar 2024 17:52:48 +0300 Subject: [PATCH] Home : Remove old modules. --- module/common/bash/module/Steam.sh | 4 ++ user/home/Default.nix | 1 - user/home/module/bin/SteamLink | 3 - user/home/module/bin/home/Backup | 76 ------------------------- user/home/module/bin/home/Nextcloud | 8 --- user/home/module/bin/home/PhotosProcess | 6 -- user/home/module/bin/home/YandexMusic | 5 -- 7 files changed, 4 insertions(+), 99 deletions(-) create mode 100644 module/common/bash/module/Steam.sh delete mode 100755 user/home/module/bin/SteamLink delete mode 100755 user/home/module/bin/home/Backup delete mode 100755 user/home/module/bin/home/Nextcloud delete mode 100755 user/home/module/bin/home/PhotosProcess delete mode 100755 user/home/module/bin/home/YandexMusic diff --git a/module/common/bash/module/Steam.sh b/module/common/bash/module/Steam.sh new file mode 100644 index 00000000..d48aedc7 --- /dev/null +++ b/module/common/bash/module/Steam.sh @@ -0,0 +1,4 @@ +# Start Steam with Wayland screen share for Link to work. +function steam_link() { + steam -pipewire -pipewire-dmabuf +} diff --git a/user/home/Default.nix b/user/home/Default.nix index e33e13e5..c03dc1b2 100644 --- a/user/home/Default.nix +++ b/user/home/Default.nix @@ -13,7 +13,6 @@ ".config/htop".source = ./module/top/htop; ".editorconfig".source = ./module/Editorconfig; ".parallel/will-cite".text = ""; - "app/bin".source = ./module/bin; "media/template".source = ./module/template; }; diff --git a/user/home/module/bin/SteamLink b/user/home/module/bin/SteamLink deleted file mode 100755 index 397f0e16..00000000 --- a/user/home/module/bin/SteamLink +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env bash - -steam -pipewire -pipewire-dmabuf diff --git a/user/home/module/bin/home/Backup b/user/home/module/bin/home/Backup deleted file mode 100755 index c17399d7..00000000 --- a/user/home/module/bin/home/Backup +++ /dev/null @@ -1,76 +0,0 @@ -#!/usr/bin/env bash - -# Source modules. -for file in /etc/bash/module/*.sh; do - source "${file}" -done - -function report() { - echo "${*}" - notify "${*}" -} - -# Define constants. -path_src="/storage/hot" -path_mount="/storage/cold_1" -path_backup="${path_mount}/backup" -path_docker="${path_backup}/home" -path_media="/storage/cold_1/media /storage/cold_2/media" - -# Check if backup drive is mounted. -if [ ! -f "${path_mount}"/.mount ]; then - report "Backup : ${path_mount} not mounted!" - exit 1 -fi - -# Check if hot storage is mounted. -if [ ! -f "${path_src}"/.mount ]; then - report "Backup : ${path_src} not mounted!" - exit 1 -fi - -# Cd to src storage. -cd "${path_src}" - -# Save media list. -find ${path_media} -type d > ${path_backup}/cold/ColdMedia.txt || report "Backup : Failed to save media list!" -cd ${path_backup}/cold/ -archive_fast ColdMedia.txt && rm ColdMedia.txt || report "Backup : Failed to archive media list!" -cd - - -# Backup docker. -docker=$(archive_fast docker/) -bupsize=$(tdu ${docker} | awk '{print $1}') -mv ${docker} ${path_docker}/ || report "Backup : Failed to save docker!" - -# Backup some media. -cd ${path_src}/media/ -paper=$(archive_fast paper/) -mv ${paper} ${path_backup}/paper/ || report "Backup : Failed to save paper!" -cd - - -# Prune media copies. -cd ${path_backup}/paper/ -archive_prune -cd - - -cd ${path_backup}/cold/ -archive_prune -cd - - -# Prune old Docker copies. -cd ${path_docker} -archive_prune Docker 7 -cd - - -# Prune game saves. -cd "${path_backup}/save/" -archive_prune -cd - - -# Sync writes. -sync - -# Notify completion & size. -notify_silent "Backup : Complete ${bupsize}." -echo "Backup : Complete ${bupsize}." diff --git a/user/home/module/bin/home/Nextcloud b/user/home/module/bin/home/Nextcloud deleted file mode 100755 index 404d7768..00000000 --- a/user/home/module/bin/home/Nextcloud +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env bash - -# Source modules. -for file in /etc/bash/module/*.sh; do - source "${file}" -done - -docker exec -u 33 cloud php -f /var/www/html/cron.php || notify 'Nextcloud : Failed to run cron.' diff --git a/user/home/module/bin/home/PhotosProcess b/user/home/module/bin/home/PhotosProcess deleted file mode 100755 index d70a676f..00000000 --- a/user/home/module/bin/home/PhotosProcess +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/env bash - -in="/storage/hot/docker/cloud/data/data/cakee/files/media/photo/" -out="/storage/cold_1/backup/tmp/photo/" - -docker run --rm -v "${in}":/in -v "${out}":/out voronind.com/photoprocess:latest diff --git a/user/home/module/bin/home/YandexMusic b/user/home/module/bin/home/YandexMusic deleted file mode 100755 index 5c0e01ef..00000000 --- a/user/home/module/bin/home/YandexMusic +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env bash - -music="/storage/hot/media/music/" - -docker run --rm -v "${music}":/music voronind.com/yamusic:latest