feat: shell modules
This commit is contained in:
24
flake.nix
24
flake.nix
@@ -735,6 +735,30 @@
|
|||||||
# -- For all systems --
|
# -- For all systems --
|
||||||
inherit dotEnv minorEnvironment parseEnv forAllSystemsWithPkgs forSpecSystemsWithPkgs;
|
inherit dotEnv minorEnvironment parseEnv forAllSystemsWithPkgs forSpecSystemsWithPkgs;
|
||||||
|
|
||||||
|
shellModules.logs = ''
|
||||||
|
RED='\033[0;31m'
|
||||||
|
GREEN='\033[0;32m'
|
||||||
|
YELLOW='\033[1;33m'
|
||||||
|
BLUE='\033[0;34m'
|
||||||
|
PURPLE='\033[0;35m'
|
||||||
|
MAGENTA="$PURPLE"
|
||||||
|
CYAN='\033[0;36m'
|
||||||
|
WHITE='\033[1;37m'
|
||||||
|
NC='\033[0m' # No Color
|
||||||
|
|
||||||
|
LOG_PATH="/var/log/hectic/activation.log"
|
||||||
|
|
||||||
|
mkdir -p "$(dirname "$LOG_PATH")"
|
||||||
|
|
||||||
|
log_info() { text=$1; shift; printf "%b ''${text}%b\n" "$BLUE" "$@" "$NC" | tee -a "$LOG_PATH" >&2; }
|
||||||
|
log_success() { text=$1; shift; printf "%b ''${text}%b\n" "$GREEN" "$@" "$NC" | tee -a "$LOG_PATH" >&2; }
|
||||||
|
log_warning() { text=$1; shift; printf "%b ''${text}%b\n" "$YELLOW" "$@" "$NC" | tee -a "$LOG_PATH" >&2; }
|
||||||
|
log_error() { text=$1; shift; printf "%b ''${text}%b\n" "$RED" "$@" "$NC" | tee -a "$LOG_PATH" >&2; }
|
||||||
|
log_step() { text=$1; shift; printf "%b ''${text}%b\n" "$PURPLE" "$@" "$NC" | tee -a "$LOG_PATH" >&2; }
|
||||||
|
|
||||||
|
log_header() { printf "\n%b=== %s ===%b\n" "$WHITE" "$@" "$NC" | tee -a "$LOG_PATH" >&2; }
|
||||||
|
'';
|
||||||
|
|
||||||
sharedShellAliases = {
|
sharedShellAliases = {
|
||||||
jc = ''journalctl'';
|
jc = ''journalctl'';
|
||||||
sc = ''journalctl'';
|
sc = ''journalctl'';
|
||||||
|
|||||||
Reference in New Issue
Block a user