machineconfig 5.26__py3-none-any.whl → 5.28__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of machineconfig might be problematic. Click here for more details.
- machineconfig/cluster/sessions_managers/zellij_local_manager.py +1 -0
- machineconfig/jobs/installer/installer_data.json +17 -0
- machineconfig/jobs/installer/linux_scripts/brave.sh +4 -14
- machineconfig/jobs/installer/linux_scripts/docker.sh +5 -17
- machineconfig/jobs/installer/linux_scripts/docker_start.sh +6 -14
- machineconfig/jobs/installer/linux_scripts/edge.sh +3 -11
- machineconfig/jobs/installer/linux_scripts/nerdfont.sh +5 -17
- machineconfig/jobs/installer/linux_scripts/pgsql.sh +3 -11
- machineconfig/jobs/installer/linux_scripts/redis.sh +5 -17
- machineconfig/jobs/installer/linux_scripts/timescaledb.sh +6 -20
- machineconfig/jobs/installer/linux_scripts/vscode.sh +5 -17
- machineconfig/jobs/installer/linux_scripts/warp-cli.sh +5 -17
- machineconfig/jobs/installer/linux_scripts/wezterm.sh +3 -11
- machineconfig/jobs/installer/package_groups.py +70 -111
- machineconfig/jobs/linux/msc/lid.sh +2 -8
- machineconfig/jobs/linux/msc/network.sh +2 -8
- machineconfig/scripts/cloud/init.sh +6 -20
- machineconfig/scripts/linux/share_cloud.sh +11 -25
- machineconfig/scripts/python/agents.py +22 -31
- machineconfig/scripts/python/cloud_repo_sync.py +14 -29
- machineconfig/scripts/python/devops.py +7 -10
- machineconfig/scripts/python/helpers/repo_sync_helpers.py +1 -1
- machineconfig/scripts/python/helpers_fire/fire_agents_help_launch.py +30 -48
- machineconfig/scripts/python/helpers_fire/fire_agents_helper_types.py +24 -6
- machineconfig/scripts/python/helpers_fire/fire_crush.json +14 -0
- machineconfig/scripts/python/helpers_fire/fire_crush.py +37 -0
- machineconfig/scripts/python/helpers_fire/fire_cursor_agents.py +23 -0
- machineconfig/scripts/python/helpers_fire/fire_gemini.py +41 -0
- machineconfig/scripts/python/helpers_fire/fire_q.py +19 -0
- machineconfig/scripts/python/helpers_fire/prompt.txt +2 -0
- machineconfig/scripts/python/helpers_fire/template.ps1 +0 -0
- machineconfig/scripts/python/helpers_fire/template.sh +31 -0
- machineconfig/scripts/python/interactive.py +21 -19
- machineconfig/scripts/python/repos.py +4 -1
- machineconfig/scripts/python/secure_repo.py +15 -0
- machineconfig/settings/broot/br.sh +0 -4
- machineconfig/setup_linux/__init__.py +2 -2
- machineconfig/setup_linux/apps.sh +7 -9
- machineconfig/setup_linux/apps_desktop.sh +11 -35
- machineconfig/setup_linux/apps_gui.sh +4 -14
- machineconfig/setup_linux/nix/cli_installation.sh +9 -29
- machineconfig/setup_linux/web_shortcuts/interactive.sh +1 -1
- machineconfig/setup_windows/__init__.py +2 -2
- machineconfig/utils/code.py +3 -3
- machineconfig/utils/files/read.py +1 -1
- machineconfig/utils/installer.py +15 -21
- machineconfig/utils/installer_utils/installer.py +3 -4
- machineconfig/utils/installer_utils/installer_abc.py +4 -4
- machineconfig/utils/installer_utils/installer_class.py +11 -46
- machineconfig/utils/io.py +0 -1
- {machineconfig-5.26.dist-info → machineconfig-5.28.dist-info}/METADATA +3 -3
- {machineconfig-5.26.dist-info → machineconfig-5.28.dist-info}/RECORD +59 -52
- {machineconfig-5.26.dist-info → machineconfig-5.28.dist-info}/entry_points.txt +0 -1
- machineconfig/scripts/linux/cloud_repo_sync +0 -2
- machineconfig/scripts/windows/cloud_repo_sync.ps1 +0 -1
- /machineconfig/setup_linux/{repos.sh → machineconfig.sh} +0 -0
- /machineconfig/setup_linux/{ve.sh → uv.sh} +0 -0
- /machineconfig/setup_windows/{repos.ps1 → machineconfig.ps1} +0 -0
- /machineconfig/setup_windows/{ve.ps1 → uv.ps1} +0 -0
- {machineconfig-5.26.dist-info → machineconfig-5.28.dist-info}/WHEEL +0 -0
- {machineconfig-5.26.dist-info → machineconfig-5.28.dist-info}/top_level.txt +0 -0
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
from pathlib import Path
|
|
3
3
|
|
|
4
4
|
APPS = Path(__file__).parent.joinpath("apps.sh")
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
MACHINECONFIG = Path(__file__).parent.joinpath("machineconfig.sh")
|
|
6
|
+
UV = Path(__file__).parent.joinpath("uv.sh")
|
|
7
7
|
|
|
8
8
|
APPS_DESKTOP = Path(__file__).parent.joinpath("apps_desktop.sh")
|
|
9
9
|
APPS_GUI = Path(__file__).parent.joinpath("apps_gui.sh")
|
|
@@ -17,6 +17,12 @@ export NVM_DIR="$HOME/.nvm"
|
|
|
17
17
|
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"
|
|
18
18
|
echo "📥 Installing latest Node.js..."
|
|
19
19
|
nvm install node || true
|
|
20
|
+
echo "📥 Installing SQLite - lightweight SQL database..."
|
|
21
|
+
echo "📥 Installing PostgreSQL client..."
|
|
22
|
+
echo "📥 Installing Redis command-line tools..."
|
|
23
|
+
sudo nala install sqlite3 -y || true
|
|
24
|
+
sudo nala install postgresql-client -y || true # # same for pgsq, when the server runs, we will need the client to talk to it.
|
|
25
|
+
sudo nala install redis-tools -y || true # this gives redis-cli, which is needed to talk to the redis-server that is running in the docker container.
|
|
20
26
|
|
|
21
27
|
# --GROUP:TerminalEyeCandy:fortune,toilet,sl,aafire,cmatrix,hollywood,chafa
|
|
22
28
|
echo "📥 Installing fortune - random wisdom generator..."
|
|
@@ -48,6 +54,7 @@ sudo nala install samba
|
|
|
48
54
|
sudo nala install fuse3 -y || true
|
|
49
55
|
sudo nala install nfs-common -y || true
|
|
50
56
|
|
|
57
|
+
|
|
51
58
|
# --GROUP:DEV_SYSTEM: graphviz,make,rust,libssl-dev,sqlite3,postgresql-client,redis-tools
|
|
52
59
|
echo "📥 Installing Graphviz - graph visualization software..."
|
|
53
60
|
echo "📥 Installing make - build automation tool..."
|
|
@@ -58,12 +65,3 @@ sudo nala install ffmpeg -y || true # Required by some dev tools
|
|
|
58
65
|
sudo nala install make -y || true # Required by LunarVim and SpaceVim
|
|
59
66
|
(curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh) || true
|
|
60
67
|
sudo nala install libssl-dev -y
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
# --GROUP:DATABASES: sqlite3,postgresql-client,redis-tools
|
|
64
|
-
echo "📥 Installing SQLite - lightweight SQL database..."
|
|
65
|
-
echo "📥 Installing PostgreSQL client..."
|
|
66
|
-
echo "📥 Installing Redis command-line tools..."
|
|
67
|
-
sudo nala install sqlite3 -y || true
|
|
68
|
-
sudo nala install postgresql-client -y || true
|
|
69
|
-
sudo nala install redis-tools -y || true
|
|
@@ -1,58 +1,42 @@
|
|
|
1
1
|
#!/usr/bin/bash
|
|
2
|
-
#=======================================================================
|
|
3
2
|
# 🖥️ DESKTOP APPLICATIONS INSTALLATION SCRIPT
|
|
4
|
-
#=======================================================================
|
|
5
3
|
# This script installs desktop applications for a Linux workstation
|
|
6
4
|
|
|
7
|
-
echo """
|
|
8
|
-
🌐 WEB BROWSERS | Installing browser applications
|
|
9
|
-
#=======================================================================
|
|
5
|
+
echo """🌐 WEB BROWSERS | Installing browser applications
|
|
10
6
|
"""
|
|
11
7
|
# Google Chrome installation (commented reference)
|
|
12
8
|
# echo "📥 Installing Google Chrome..."
|
|
13
9
|
# wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
|
|
14
10
|
# sudo dpkg -i google-chrome-stable_current_amd64.deb
|
|
15
11
|
|
|
16
|
-
echo """
|
|
17
|
-
📝 TEXT EDITORS | Installing Neovim editor
|
|
18
|
-
#=======================================================================
|
|
12
|
+
echo """📝 TEXT EDITORS | Installing Neovim editor
|
|
19
13
|
"""
|
|
20
14
|
echo "📥 Installing Neovim via Homebrew..."
|
|
21
15
|
/home/linuxbrew/.linuxbrew/bin/brew install neovim
|
|
22
16
|
|
|
23
|
-
echo """
|
|
24
|
-
📧 EMAIL CLIENT | Installing Thunderbird
|
|
25
|
-
#=======================================================================
|
|
17
|
+
echo """📧 EMAIL CLIENT | Installing Thunderbird
|
|
26
18
|
"""
|
|
27
19
|
echo "📥 Installing Thunderbird via Flatpak..."
|
|
28
20
|
flatpak install flathub org.mozilla.Thunderbird
|
|
29
21
|
|
|
30
|
-
echo """
|
|
31
|
-
🖲️ TERMINAL EMULATOR | Installing WezTerm
|
|
32
|
-
#=======================================================================
|
|
22
|
+
echo """🖲️ TERMINAL EMULATOR | Installing WezTerm
|
|
33
23
|
"""
|
|
34
24
|
echo "📥 Installing WezTerm via Flatpak..."
|
|
35
25
|
flatpak install flathub org.wezfurlong.wezterm
|
|
36
26
|
echo "🚀 Launching WezTerm..."
|
|
37
27
|
flatpak run org.wezfurlong.wezterm
|
|
38
28
|
|
|
39
|
-
echo """
|
|
40
|
-
✏️ SCREEN ANNOTATION | Installing Gromit-MPX
|
|
41
|
-
#=======================================================================
|
|
29
|
+
echo """✏️ SCREEN ANNOTATION | Installing Gromit-MPX
|
|
42
30
|
"""
|
|
43
31
|
echo "📥 Installing Gromit-MPX via Flatpak..."
|
|
44
32
|
flatpak install net.christianbeier.Gromit-MPX
|
|
45
33
|
|
|
46
|
-
echo """
|
|
47
|
-
📋 CLIPBOARD MANAGERS | Installing CopyQ
|
|
48
|
-
#=======================================================================
|
|
34
|
+
echo """📋 CLIPBOARD MANAGERS | Installing CopyQ
|
|
49
35
|
"""
|
|
50
36
|
echo "📥 Installing CopyQ via Flatpak..."
|
|
51
37
|
flatpak install flathub com.github.hluk.copyq --noninteractive
|
|
52
38
|
|
|
53
|
-
echo """
|
|
54
|
-
🔗 REMOTE DESKTOP | Installing Remmina
|
|
55
|
-
#=======================================================================
|
|
39
|
+
echo """🔗 REMOTE DESKTOP | Installing Remmina
|
|
56
40
|
"""
|
|
57
41
|
echo "📥 Installing Remmina and RDP plugin..."
|
|
58
42
|
sudo nala install remmina remmina-plugin-rdp -y
|
|
@@ -65,16 +49,12 @@ sudo nala install remmina remmina-plugin-rdp -y
|
|
|
65
49
|
# flatpak install --user flathub org.remmina.Remmina
|
|
66
50
|
# flatpak run --user org.remmina.Remmina
|
|
67
51
|
|
|
68
|
-
echo """
|
|
69
|
-
🚀 APPLICATION LAUNCHER | Installing Rofi
|
|
70
|
-
#=======================================================================
|
|
52
|
+
echo """🚀 APPLICATION LAUNCHER | Installing Rofi
|
|
71
53
|
"""
|
|
72
54
|
echo "📥 Installing Rofi application launcher..."
|
|
73
55
|
sudo nala install rofi -y
|
|
74
56
|
|
|
75
|
-
echo """
|
|
76
|
-
📎 CLIPBOARD HISTORY | Installing Greenclip
|
|
77
|
-
#=======================================================================
|
|
57
|
+
echo """📎 CLIPBOARD HISTORY | Installing Greenclip
|
|
78
58
|
"""
|
|
79
59
|
# Session type detection (reference)
|
|
80
60
|
# session_type=$(echo $XDG_SESSION_TYPE)
|
|
@@ -100,14 +80,10 @@ echo "- With Rofi: rofi -modi \"clipboard:greenclip print\" -show clipboard -run
|
|
|
100
80
|
echo "- For emoji picker: rofi -modi \"emoji:rofimoji\" -show emoji"
|
|
101
81
|
echo "- Application launcher: rofi -show drun"
|
|
102
82
|
|
|
103
|
-
echo """
|
|
104
|
-
🔄 APPLICATION LINKING | Linking applications to user space
|
|
105
|
-
#=======================================================================
|
|
83
|
+
echo """🔄 APPLICATION LINKING | Linking applications to user space
|
|
106
84
|
"""
|
|
107
85
|
echo "🔗 Creating application symlinks..."
|
|
108
86
|
ln -s /home/$USER/.nix-profile/share/applications/* /home/$USER/.local/share/applications/
|
|
109
87
|
|
|
110
|
-
echo """
|
|
111
|
-
✅ INSTALLATION COMPLETE | Desktop applications have been installed
|
|
112
|
-
#=======================================================================
|
|
88
|
+
echo """✅ INSTALLATION COMPLETE | Desktop applications have been installed
|
|
113
89
|
"""
|
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
#!/bin/bash
|
|
2
|
-
#=======================================================================
|
|
3
2
|
# 🖥️ GUI APPLICATIONS AND DESKTOP ENVIRONMENT SETUP SCRIPT
|
|
4
|
-
#=======================================================================
|
|
5
3
|
# This script installs graphical user interfaces and desktop environments
|
|
6
4
|
|
|
7
|
-
echo """
|
|
8
|
-
📦 INSTALLING GUI COMPONENTS | Setting up desktop environment
|
|
9
|
-
#=======================================================================
|
|
5
|
+
echo """📦 INSTALLING GUI COMPONENTS | Setting up desktop environment
|
|
10
6
|
"""
|
|
11
7
|
|
|
12
8
|
# echo "📥 Installing Nautilus file manager..."
|
|
@@ -27,9 +23,7 @@ sudo nala install xfce4 -y # 🏠 xfce4 desktop environment
|
|
|
27
23
|
echo "📥 Installing XFCE4 additional components..."
|
|
28
24
|
sudo nala install xfce4-goodies -y # ✨ xfce4 desktop environment extras
|
|
29
25
|
|
|
30
|
-
echo """
|
|
31
|
-
🔧 CONFIGURING XRDP | Setting up Remote Desktop service
|
|
32
|
-
#=======================================================================
|
|
26
|
+
echo """🔧 CONFIGURING XRDP | Setting up Remote Desktop service
|
|
33
27
|
"""
|
|
34
28
|
|
|
35
29
|
# Back up original configuration
|
|
@@ -55,17 +49,13 @@ sudo sed -i 's/test/#test/g' /etc/xrdp/startwm.sh
|
|
|
55
49
|
sudo sed -i 's/exec/#exec/g' /etc/xrdp/startwm.sh
|
|
56
50
|
echo "startxfce4" | sudo tee -a /etc/xrdp/startwm.sh
|
|
57
51
|
|
|
58
|
-
echo """
|
|
59
|
-
🚀 STARTING SERVICES | Initializing XRDP service
|
|
60
|
-
#=======================================================================
|
|
52
|
+
echo """🚀 STARTING SERVICES | Initializing XRDP service
|
|
61
53
|
"""
|
|
62
54
|
|
|
63
55
|
echo "🔄 Starting XRDP service..."
|
|
64
56
|
sudo /etc/init.d/xrdp start
|
|
65
57
|
|
|
66
|
-
echo """
|
|
67
|
-
✅ SETUP COMPLETE | GUI environment has been configured
|
|
68
|
-
#=======================================================================
|
|
58
|
+
echo """✅ SETUP COMPLETE | GUI environment has been configured
|
|
69
59
|
"""
|
|
70
60
|
echo "ℹ️ Connect to this machine via Remote Desktop using port 3391"
|
|
71
61
|
# Alternative commands:
|
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
#!/bin/bash
|
|
2
|
-
#=======================================================================
|
|
3
2
|
# 📦 NIX CLI TOOLS INSTALLATION SCRIPT
|
|
4
|
-
#=======================================================================
|
|
5
3
|
# This script installs various command-line utilities using the Nix package manager
|
|
6
4
|
|
|
7
|
-
echo """
|
|
8
|
-
🔄 SYSTEM UTILITIES | Installing system management tools
|
|
9
|
-
#=======================================================================
|
|
5
|
+
echo """🔄 SYSTEM UTILITIES | Installing system management tools
|
|
10
6
|
"""
|
|
11
7
|
|
|
12
8
|
# System upgrade tool
|
|
@@ -21,9 +17,7 @@ nix-env -iA nixpkgs.procs || true
|
|
|
21
17
|
echo "📥 Installing watchexec - executes commands when files change..."
|
|
22
18
|
nix-env -iA nixpkgs.watchexec || true
|
|
23
19
|
|
|
24
|
-
echo """
|
|
25
|
-
📂 FILE MANAGEMENT | Installing file browsers and utilities
|
|
26
|
-
#=======================================================================
|
|
20
|
+
echo """📂 FILE MANAGEMENT | Installing file browsers and utilities
|
|
27
21
|
"""
|
|
28
22
|
|
|
29
23
|
# Terminal file managers
|
|
@@ -56,9 +50,7 @@ nix-env -iA nixpkgs.diskonaut || true
|
|
|
56
50
|
echo "📥 Installing kondo - cleanup tool for dev projects..."
|
|
57
51
|
nix-env -iA nixpkgs.kondo || true
|
|
58
52
|
|
|
59
|
-
echo """
|
|
60
|
-
🖼️ VISUAL TOOLS | Installing terminal visualization tools
|
|
61
|
-
#=======================================================================
|
|
53
|
+
echo """🖼️ VISUAL TOOLS | Installing terminal visualization tools
|
|
62
54
|
"""
|
|
63
55
|
|
|
64
56
|
# Terminal visualization
|
|
@@ -71,9 +63,7 @@ nix-env -iA nixpkgs.bottom || true
|
|
|
71
63
|
echo "📥 Installing delta - syntax-highlighting pager for git..."
|
|
72
64
|
nix-env -iA nixpkgs.delta || true
|
|
73
65
|
|
|
74
|
-
echo """
|
|
75
|
-
🔧 DEVELOPMENT TOOLS | Installing programming utilities
|
|
76
|
-
#=======================================================================
|
|
66
|
+
echo """🔧 DEVELOPMENT TOOLS | Installing programming utilities
|
|
77
67
|
"""
|
|
78
68
|
|
|
79
69
|
# Code editors
|
|
@@ -95,9 +85,7 @@ nix-env -iA nixpkgs.tokei || true
|
|
|
95
85
|
echo "📥 Installing gitui - terminal UI for git..."
|
|
96
86
|
nix-env -iA nixpkgs.gitui || true
|
|
97
87
|
|
|
98
|
-
echo """
|
|
99
|
-
🔎 SEARCH TOOLS | Installing fuzzy finders and search utilities
|
|
100
|
-
#=======================================================================
|
|
88
|
+
echo """🔎 SEARCH TOOLS | Installing fuzzy finders and search utilities
|
|
101
89
|
"""
|
|
102
90
|
|
|
103
91
|
# Search history
|
|
@@ -108,9 +96,7 @@ nix-env -iA nixpkgs.mcfly || true
|
|
|
108
96
|
echo "📥 Installing skim - fuzzy finder in Rust..."
|
|
109
97
|
nix-env -iA nixpkgs.skim || true
|
|
110
98
|
|
|
111
|
-
echo """
|
|
112
|
-
🌐 NETWORK & CLOUD TOOLS | Installing file transfer and cloud utilities
|
|
113
|
-
#=======================================================================
|
|
99
|
+
echo """🌐 NETWORK & CLOUD TOOLS | Installing file transfer and cloud utilities
|
|
114
100
|
"""
|
|
115
101
|
|
|
116
102
|
# File transfer
|
|
@@ -121,18 +107,14 @@ nix-env -iA nixpkgs.termscp || true
|
|
|
121
107
|
echo "📥 Installing rclone - rsync for cloud storage..."
|
|
122
108
|
nix-env -iA nixpkgs.rclone || true
|
|
123
109
|
|
|
124
|
-
echo """
|
|
125
|
-
🛡️ SECURITY TOOLS | Installing password management utilities
|
|
126
|
-
#=======================================================================
|
|
110
|
+
echo """🛡️ SECURITY TOOLS | Installing password management utilities
|
|
127
111
|
"""
|
|
128
112
|
|
|
129
113
|
# Password management
|
|
130
114
|
echo "📥 Installing gopass - team password manager with git..."
|
|
131
115
|
nix-env -iA nixpkgs.gopass || true
|
|
132
116
|
|
|
133
|
-
echo """
|
|
134
|
-
📚 DOCUMENTATION | Installing help and reference tools
|
|
135
|
-
#=======================================================================
|
|
117
|
+
echo """📚 DOCUMENTATION | Installing help and reference tools
|
|
136
118
|
"""
|
|
137
119
|
|
|
138
120
|
# Command reference
|
|
@@ -143,9 +125,7 @@ nix-env -iA nixpkgs.tldr || true
|
|
|
143
125
|
echo "📥 Installing nushell - modern shell alternative..."
|
|
144
126
|
nix-env -iA nixpkgs.nushell || true
|
|
145
127
|
|
|
146
|
-
echo """
|
|
147
|
-
✅ INSTALLATION COMPLETE | All Nix CLI tools have been installed
|
|
148
|
-
#=======================================================================
|
|
128
|
+
echo """✅ INSTALLATION COMPLETE | All Nix CLI tools have been installed
|
|
149
129
|
"""
|
|
150
130
|
|
|
151
131
|
# Commented out tools
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
#!/bin/bash
|
|
2
2
|
|
|
3
|
-
. <( curl -sSL "https://raw.githubusercontent.com/thisismygitrepo/machineconfig/main/src/machineconfig/setup_linux/
|
|
3
|
+
. <( curl -sSL "https://raw.githubusercontent.com/thisismygitrepo/machineconfig/main/src/machineconfig/setup_linux/uv.sh")
|
|
4
4
|
$HOME/.local/bin/uv run --python 3.13 --with machineconfig devops self interactive
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
from pathlib import Path
|
|
3
3
|
|
|
4
4
|
APPS = Path(__file__).parent.joinpath("apps.ps1")
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
MACHINECONFIG = Path(__file__).parent.joinpath("machineconfig.ps1")
|
|
6
|
+
UV = Path(__file__).parent.joinpath("uv.ps1")
|
|
7
7
|
|
|
8
8
|
DOCKER = Path(__file__).parent.joinpath("others/docker.ps1")
|
|
9
9
|
OBS = Path(__file__).parent.joinpath("others/obs.ps1")
|
machineconfig/utils/code.py
CHANGED
|
@@ -98,7 +98,7 @@ def print_code(code: str, lexer: str, desc: str, subtitle: str = ""):
|
|
|
98
98
|
console.print(Panel(Syntax(code=code, lexer=lexer), title=f"📄 {desc}", subtitle=subtitle), style="bold red")
|
|
99
99
|
|
|
100
100
|
|
|
101
|
-
def run_shell_script(
|
|
101
|
+
def run_shell_script(script: str, display_script: bool = True):
|
|
102
102
|
import tempfile
|
|
103
103
|
if platform.system() == "Windows":
|
|
104
104
|
suffix = ".ps1"
|
|
@@ -107,12 +107,12 @@ def run_shell_script(program: str, display_script: bool = True):
|
|
|
107
107
|
suffix = ".sh"
|
|
108
108
|
lexer = "bash"
|
|
109
109
|
with tempfile.NamedTemporaryFile(mode='w', suffix=suffix, delete=False, encoding='utf-8') as temp_file:
|
|
110
|
-
temp_file.write(
|
|
110
|
+
temp_file.write(script)
|
|
111
111
|
temp_script_path = PathExtended(temp_file.name)
|
|
112
112
|
console = Console()
|
|
113
113
|
if display_script:
|
|
114
114
|
from rich.syntax import Syntax
|
|
115
|
-
console.print(Panel(Syntax(code=
|
|
115
|
+
console.print(Panel(Syntax(code=script, lexer=lexer), title=f"📄 shell script @ {temp_script_path}", subtitle="shell script being executed"), style="bold red")
|
|
116
116
|
|
|
117
117
|
if platform.system() == "Windows":
|
|
118
118
|
import subprocess
|
|
@@ -21,7 +21,7 @@ class Read:
|
|
|
21
21
|
if "type object 'Read' has no attribute" not in str(err): raise AttributeError(err) from err
|
|
22
22
|
if suffix in ('eps', 'jpg', 'jpeg', 'pdf', 'pgf', 'png', 'ps', 'raw', 'rgba', 'svg', 'svgz', 'tif', 'tiff'):
|
|
23
23
|
import matplotlib.pyplot as pyplot
|
|
24
|
-
return pyplot.imread(path, **kwargs) # from: plt.gcf().canvas.get_supported_filetypes().keys():
|
|
24
|
+
return pyplot.imread(str(path), **kwargs) # from: plt.gcf().canvas.get_supported_filetypes().keys():
|
|
25
25
|
if suffix == "parquet":
|
|
26
26
|
import polars as pl
|
|
27
27
|
return pl.read_parquet(path, **kwargs)
|
machineconfig/utils/installer.py
CHANGED
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
"""package manager"""
|
|
2
2
|
|
|
3
3
|
from machineconfig.utils.installer_utils.installer_abc import check_if_installed_already, parse_apps_installer_linux, parse_apps_installer_windows
|
|
4
|
-
|
|
5
4
|
from machineconfig.utils.installer_utils.installer_class import Installer
|
|
6
5
|
from machineconfig.utils.schemas.installer.installer_types import InstallerData, InstallerDataFiles, get_normalized_arch, get_os_name, OPERATING_SYSTEMS, CPU_ARCHITECTURES
|
|
7
6
|
from machineconfig.jobs.installer.package_groups import PACKAGE_GROUPS, PACKAGE_GROUP2NAMES
|
|
8
|
-
from rich.console import Console
|
|
9
|
-
from rich.panel import Panel
|
|
10
|
-
|
|
11
7
|
from machineconfig.utils.path_extended import PathExtended
|
|
12
8
|
from machineconfig.utils.source_of_truth import INSTALL_VERSION_ROOT, LINUX_INSTALL_PATH, LIBRARY_ROOT
|
|
13
9
|
from machineconfig.utils.io import read_json
|
|
14
10
|
|
|
11
|
+
from rich.console import Console
|
|
12
|
+
from rich.panel import Panel
|
|
15
13
|
from typing import Any, Optional
|
|
16
14
|
import platform
|
|
17
15
|
from joblib import Parallel, delayed
|
|
@@ -74,7 +72,7 @@ def check_latest():
|
|
|
74
72
|
|
|
75
73
|
|
|
76
74
|
def get_installed_cli_apps():
|
|
77
|
-
print(
|
|
75
|
+
print("🔍 LISTING INSTALLED CLI APPS 🔍")
|
|
78
76
|
if platform.system() == "Windows":
|
|
79
77
|
print("🪟 Searching for Windows executables...")
|
|
80
78
|
apps = PathExtended.home().joinpath("AppData/Local/Microsoft/WindowsApps").search("*.exe", not_in=["notepad"])
|
|
@@ -89,12 +87,12 @@ def get_installed_cli_apps():
|
|
|
89
87
|
print(error_msg)
|
|
90
88
|
raise NotImplementedError(error_msg)
|
|
91
89
|
apps = [app for app in apps if app.size("kb") > 0.1 and not app.is_symlink()] # no symlinks like paint and wsl and bash
|
|
92
|
-
print(f"✅ Found {len(apps)} installed applications
|
|
90
|
+
print(f"✅ Found {len(apps)} installed applications")
|
|
93
91
|
return apps
|
|
94
92
|
|
|
95
93
|
|
|
96
94
|
def get_installers(os: OPERATING_SYSTEMS, arch: CPU_ARCHITECTURES, which_cats: Optional[list[PACKAGE_GROUPS]]) -> list[InstallerData]:
|
|
97
|
-
print(
|
|
95
|
+
print("🔍 LOADING INSTALLER CONFIGURATIONS 🔍")
|
|
98
96
|
res_all = get_all_installer_data_files()
|
|
99
97
|
acceptable_apps_names: list[str] | None = None
|
|
100
98
|
if which_cats is not None:
|
|
@@ -111,14 +109,15 @@ def get_installers(os: OPERATING_SYSTEMS, arch: CPU_ARCHITECTURES, which_cats: O
|
|
|
111
109
|
if installer_data["fileNamePattern"][arch][os] is None:
|
|
112
110
|
continue
|
|
113
111
|
all_installers.append(installer_data)
|
|
114
|
-
print(f"✅ Loaded {len(all_installers)} installer configurations
|
|
112
|
+
print(f"✅ Loaded {len(all_installers)} installer configurations")
|
|
115
113
|
return all_installers
|
|
116
114
|
|
|
117
115
|
|
|
118
116
|
def get_all_installer_data_files() -> list[InstallerData]:
|
|
119
|
-
print(
|
|
117
|
+
print("📂 LOADING CONFIGURATION FILES 📂")
|
|
120
118
|
import machineconfig.jobs.installer as module
|
|
121
119
|
from pathlib import Path
|
|
120
|
+
|
|
122
121
|
print("📂 Loading configuration files...")
|
|
123
122
|
res_raw: InstallerDataFiles = read_json(Path(module.__file__).parent.joinpath("installer_data.json"))
|
|
124
123
|
res_final: list[InstallerData] = res_raw["installers"]
|
|
@@ -129,6 +128,7 @@ def get_all_installer_data_files() -> list[InstallerData]:
|
|
|
129
128
|
def get_installers_system_groups():
|
|
130
129
|
res_final: list[InstallerData] = []
|
|
131
130
|
from platform import system
|
|
131
|
+
|
|
132
132
|
if system() == "Windows":
|
|
133
133
|
options_system = parse_apps_installer_windows(LIBRARY_ROOT.joinpath("setup_windows/apps.ps1").read_text(encoding="utf-8"))
|
|
134
134
|
elif system() == "Linux" or system() == "Darwin":
|
|
@@ -137,19 +137,13 @@ def get_installers_system_groups():
|
|
|
137
137
|
raise NotImplementedError(f"❌ System {system()} not supported")
|
|
138
138
|
os_name = get_os_name()
|
|
139
139
|
for group_name, (docs, script) in options_system.items():
|
|
140
|
-
item: InstallerData = {
|
|
141
|
-
|
|
142
|
-
"doc": docs,
|
|
143
|
-
"repoURL": "CMD",
|
|
144
|
-
"fileNamePattern": {
|
|
145
|
-
"amd64": {os_name: script,},
|
|
146
|
-
"arm64": {os_name: script,},}}
|
|
147
|
-
res_final.append(item)
|
|
140
|
+
item: InstallerData = {"appName": group_name, "doc": docs, "repoURL": "CMD", "fileNamePattern": {"amd64": {os_name: script}, "arm64": {os_name: script}}}
|
|
141
|
+
res_final.append(item)
|
|
148
142
|
return res_final
|
|
149
143
|
|
|
150
144
|
|
|
151
145
|
def install_bulk(installers_data: list[InstallerData], safe: bool = False, jobs: int = 10, fresh: bool = False):
|
|
152
|
-
print(
|
|
146
|
+
print("🚀 BULK INSTALLATION PROCESS 🚀")
|
|
153
147
|
if fresh:
|
|
154
148
|
print("🧹 Fresh install requested - clearing version cache...")
|
|
155
149
|
PathExtended(INSTALL_VERSION_ROOT).delete(sure=True)
|
|
@@ -182,10 +176,10 @@ def install_bulk(installers_data: list[InstallerData], safe: bool = False, jobs:
|
|
|
182
176
|
# return None
|
|
183
177
|
|
|
184
178
|
print(f"🚀 Starting installation of {len(installers_data)} packages...")
|
|
185
|
-
print(
|
|
179
|
+
print("📦 INSTALLING FIRST PACKAGE 📦")
|
|
186
180
|
Installer(installers_data[0]).install(version=None)
|
|
187
181
|
installers_remaining = installers_data[1:]
|
|
188
|
-
print(
|
|
182
|
+
print("📦 INSTALLING REMAINING PACKAGES 📦")
|
|
189
183
|
|
|
190
184
|
# Use joblib for parallel processing of remaining installers
|
|
191
185
|
res = Parallel(n_jobs=jobs)(delayed(lambda x: Installer(x).install_robust(version=None))(installer) for installer in installers_remaining)
|
|
@@ -218,11 +212,11 @@ def install_bulk(installers_data: list[InstallerData], safe: bool = False, jobs:
|
|
|
218
212
|
print("\n" * 2)
|
|
219
213
|
|
|
220
214
|
|
|
221
|
-
|
|
222
215
|
def get_machineconfig_version() -> str:
|
|
223
216
|
from importlib.metadata import PackageNotFoundError, version as _pkg_version
|
|
224
217
|
from pathlib import Path
|
|
225
218
|
import tomllib
|
|
219
|
+
|
|
226
220
|
name: str = "machineconfig"
|
|
227
221
|
try:
|
|
228
222
|
return _pkg_version(name)
|
|
@@ -57,12 +57,13 @@ def main_with_parser():
|
|
|
57
57
|
|
|
58
58
|
def main(
|
|
59
59
|
which: Optional[str] = typer.Option(None, "--which", "-w", help="Comma-separated list of program names to install."),
|
|
60
|
-
group: Optional[
|
|
60
|
+
group: Optional[str] = typer.Option(None, "--group", "-g", help="Groups names. A group is bundle of apps. See available groups when running interactively."),
|
|
61
61
|
interactive: bool = typer.Option(False, "--interactive", "-ia", help="Interactive selection of programs to install."),
|
|
62
62
|
) -> None:
|
|
63
63
|
if which is not None:
|
|
64
64
|
return install_clis(clis_names=[x.strip() for x in which.split(",") if x.strip() != ""])
|
|
65
65
|
if group is not None:
|
|
66
|
+
# for a_group in group
|
|
66
67
|
return install_group(package_group=group)
|
|
67
68
|
if interactive:
|
|
68
69
|
return install_interactively()
|
|
@@ -82,13 +83,11 @@ def install_interactively():
|
|
|
82
83
|
installer_options = []
|
|
83
84
|
for x in installers:
|
|
84
85
|
installer_options.append(Installer(installer_data=x).get_description())
|
|
85
|
-
|
|
86
86
|
# Build category options and maintain a mapping from display text to actual category name
|
|
87
87
|
category_display_to_name: dict[str, str] = {}
|
|
88
88
|
for group_name, group_values in PACKAGE_GROUP2NAMES.items():
|
|
89
89
|
display = f"📦 {group_name:<20}" + " -- " + f"{'|'.join(group_values):<60}"
|
|
90
90
|
category_display_to_name[display] = group_name
|
|
91
|
-
|
|
92
91
|
options_system = get_installers_system_groups()
|
|
93
92
|
for item in options_system:
|
|
94
93
|
display = f"📦 {item['appName']:<20} -- {item['doc']:<60}"
|
|
@@ -114,7 +113,7 @@ def install_interactively():
|
|
|
114
113
|
console.print(panel)
|
|
115
114
|
|
|
116
115
|
|
|
117
|
-
def install_group(package_group:
|
|
116
|
+
def install_group(package_group: str):
|
|
118
117
|
panel = Panel(f"[bold yellow]Installing programs from category: [green]{package_group}[/green][/bold yellow]", title="[bold blue]📦 Category Installation[/bold blue]", border_style="blue", padding=(1, 2))
|
|
119
118
|
console.print(panel)
|
|
120
119
|
from machineconfig.utils.installer import get_installers, install_bulk
|
|
@@ -9,7 +9,7 @@ import platform
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
def find_move_delete_windows(downloaded_file_path: PathExtended, exe_name: Optional[str] = None, delete: bool = True, rename_to: Optional[str] = None):
|
|
12
|
-
print(f"
|
|
12
|
+
print(f"🔍 PROCESSING WINDOWS EXECUTABLE 🔍")
|
|
13
13
|
if exe_name is not None and ".exe" in exe_name:
|
|
14
14
|
exe_name = exe_name.replace(".exe", "")
|
|
15
15
|
if downloaded_file_path.is_file():
|
|
@@ -54,7 +54,7 @@ def find_move_delete_windows(downloaded_file_path: PathExtended, exe_name: Optio
|
|
|
54
54
|
|
|
55
55
|
|
|
56
56
|
def find_move_delete_linux(downloaded: PathExtended, tool_name: str, delete: Optional[bool] = True, rename_to: Optional[str] = None):
|
|
57
|
-
print(f"
|
|
57
|
+
print(f"🔍 PROCESSING LINUX EXECUTABLE 🔍")
|
|
58
58
|
if downloaded.is_file():
|
|
59
59
|
exe = downloaded
|
|
60
60
|
print(f"📄 Found direct executable file: {exe}")
|
|
@@ -108,7 +108,7 @@ def find_move_delete_linux(downloaded: PathExtended, tool_name: str, delete: Opt
|
|
|
108
108
|
print("✅ Temporary files removed")
|
|
109
109
|
|
|
110
110
|
exe_new_location = PathExtended(LINUX_INSTALL_PATH).joinpath(exe.name)
|
|
111
|
-
print(f"✅ Executable installed at: {exe_new_location}
|
|
111
|
+
print(f"✅ Executable installed at: {exe_new_location}")
|
|
112
112
|
return exe_new_location
|
|
113
113
|
|
|
114
114
|
|
|
@@ -134,7 +134,7 @@ def is_executable_in_path(executable_name: str) -> bool:
|
|
|
134
134
|
|
|
135
135
|
|
|
136
136
|
def check_if_installed_already(exe_name: str, version: Optional[str], use_cache: bool) -> tuple[str, str, str]:
|
|
137
|
-
print(f"
|
|
137
|
+
print(f"🔍 CHECKING INSTALLATION STATUS: {exe_name} 🔍")
|
|
138
138
|
INSTALL_VERSION_ROOT.joinpath(exe_name).parent.mkdir(parents=True, exist_ok=True)
|
|
139
139
|
tmp_path = INSTALL_VERSION_ROOT.joinpath(exe_name)
|
|
140
140
|
|