Update .local/share/chezmoi/software.yml, .local/share/chezmoi/home/dot_local/bin/executable_install-program

This commit is contained in:
Brian Zalewski 2022-12-09 05:19:29 +00:00
parent a1f0b9366e
commit d261280dc1
2 changed files with 123 additions and 39 deletions

View file

@ -77,7 +77,8 @@ let installData;
const installOrders = {}; const installOrders = {};
const installOrdersPre = []; const installOrdersPre = [];
const installOrdersPost = []; const installOrdersPost = [];
let osType, osID; const installOrdersSystemd = [];
let brewUpdated, osType, osID, snapRefreshed;
// Download the installation map // Download the installation map
async function downloadInstallData() { async function downloadInstallData() {
@ -353,7 +354,8 @@ async function generateInstallOrders() {
softwarePackages[packageKey], softwarePackages[packageKey],
preference + ":" + osID, preference + ":" + osID,
pkg, pkg,
packageKey packageKey,
softwarePackages
); );
break; break;
} else if (softwarePackages[packageKey][preference + ":" + osType]) { } else if (softwarePackages[packageKey][preference + ":" + osType]) {
@ -362,7 +364,8 @@ async function generateInstallOrders() {
softwarePackages[packageKey], softwarePackages[packageKey],
preference + ":" + osType, preference + ":" + osType,
pkg, pkg,
packageKey packageKey,
softwarePackages
); );
break; break;
} else if (softwarePackages[packageKey][preference]) { } else if (softwarePackages[packageKey][preference]) {
@ -371,7 +374,8 @@ async function generateInstallOrders() {
softwarePackages[packageKey], softwarePackages[packageKey],
preference, preference,
pkg, pkg,
packageKey packageKey,
softwarePackages
); );
break; break;
} }
@ -387,7 +391,8 @@ async function updateInstallMaps(
packages, packages,
scopedPreference, scopedPreference,
pkg, pkg,
packageKey packageKey,
softwarePackages
) { ) {
const preHook = getHook(packages, "pre", scopedPreference, preference); const preHook = getHook(packages, "pre", scopedPreference, preference);
if (preHook) { if (preHook) {
@ -399,6 +404,12 @@ async function updateInstallMaps(
typeof postHook === "string" ? [postHook] : postHook typeof postHook === "string" ? [postHook] : postHook
); );
} }
const systemdHook = getHook(packages, "systemd", scopedPreference, preference)
if (systemdHook) {
installOrdersSystemd.concat(
typeof systemdHook === "string" ? [systemdHook] : systemdHook
);
}
if (!installOrders[preference]) { if (!installOrders[preference]) {
installOrders[preference] = []; installOrders[preference] = [];
} }
@ -409,8 +420,15 @@ async function updateInstallMaps(
); );
const newPackages = packages[scopedPreference]; const newPackages = packages[scopedPreference];
const newPkgs = typeof newPackages === "string" ? [newPackages] : newPackages; const newPkgs = typeof newPackages === "string" ? [newPackages] : newPackages;
if (preference === 'snap' && softwarePackages["_snapClassic"] === true) {
if (!installOrders[preference + '-classic']) {
installOrders[preference + '-classic'] = [];
}
installOrders[preference + '-classic'] = installOrders[preference].concat(newPkgs);
} else {
installOrders[preference] = installOrders[preference].concat(newPkgs); installOrders[preference] = installOrders[preference].concat(newPkgs);
} }
}
// Get pre / post install hooks // Get pre / post install hooks
function getHook(packages, hook, scopedPreference, preference) { function getHook(packages, hook, scopedPreference, preference) {
@ -556,7 +574,10 @@ async function beforeInstall(packageManager) {
} else if (packageManager === "basher") { } else if (packageManager === "basher") {
} else if (packageManager === "binary") { } else if (packageManager === "binary") {
} else if (packageManager === "brew" || packageManager === "cask") { } else if (packageManager === "brew" || packageManager === "cask") {
if (!brewUpdated) {
brewUpdated = true
await $`brew update`; await $`brew update`;
}
} else if (packageManager === "cargo") { } else if (packageManager === "cargo") {
} else if (packageManager === "choco") { } else if (packageManager === "choco") {
} else if (packageManager === "crew") { } else if (packageManager === "crew") {
@ -594,8 +615,11 @@ async function beforeInstall(packageManager) {
} }
} else if (packageManager === "scoop") { } else if (packageManager === "scoop") {
await $`scoop update`; await $`scoop update`;
} else if (packageManager === "snap") { } else if (packageManager === "snap" || packageManager === "snap-classic") {
if (!snapRefreshed) {
snapRefreshed = true
await $`sudo snap refresh`; await $`sudo snap refresh`;
}
} else if (packageManager === "whalebrew") { } else if (packageManager === "whalebrew") {
if (osType === "darwin") { if (osType === "darwin") {
const docker = which.sync("docker", { nothrow: true }); const docker = which.sync("docker", { nothrow: true });
@ -960,6 +984,8 @@ async function ensurePackageManager(packageManager) {
const snap = which.sync("snap", { nothrow: true }); const snap = which.sync("snap", { nothrow: true });
if (snap) { if (snap) {
$`sudo snap install core`; $`sudo snap install core`;
} else {
log("warn", logStage, 'Snap installation sequence completed but the snap bin is still not available')
} }
} else if (packageManager === "whalebrew") { } else if (packageManager === "whalebrew") {
await ensureInstalled("whalebrew", $`brew install whalebrew`); await ensureInstalled("whalebrew", $`brew install whalebrew`);
@ -1241,6 +1267,14 @@ async function installPackageList(packageManager, packages) {
); );
} }
} }
} else if (packageManager === "snap-classic") {
for (let pkg of packages) {
try {
await $`sudo snap install --classic -y ${pkg}`
} catch(e) {
log("error", "Snap Failure", `There was an error installing ${pkg} with snap in classic mode`)
}
}
} else if (packageManager === "whalebrew") { } else if (packageManager === "whalebrew") {
for (let pkg of packages) { for (let pkg of packages) {
try { try {
@ -1300,6 +1334,23 @@ async function installPackageList(packageManager, packages) {
} }
} }
async function updateSystemd(service) {
const logStage = 'Systemd Service'
if(osType === 'linux') {
const systemd = which.sync('systemctl', { nothrow: true })
if (systemd) {
try {
log("info", logStage, `Starting / enabling the ${service} service`)
await $`sudo systemctl enable --now ${service}`
} catch (e) {
log("error", logStage, `There was an error starting / enabling the ${service} service`)
}
} else {
log("warn", logStage, `The systemctl command is not available so applications with services cannot be started / enabled`)
}
}
}
// main process // main process
async function main() { async function main() {
osType = await OSType(); osType = await OSType();
@ -1355,6 +1406,9 @@ async function main() {
"Package Post-Install", "Package Post-Install",
`Running package-specific post-installation steps` `Running package-specific post-installation steps`
); );
for (const service of installOrdersSystemd) {
await updateSystemd(service);
}
for (const script of installOrdersPost) { for (const script of installOrdersPost) {
await $`${script}`; await $`${script}`;
} }

View file

@ -789,7 +789,7 @@ softwarePackages:
github: github.com/cerebroapp/cerebro github: github.com/cerebroapp/cerebro
yay: cerebro yay: cerebro
certbot: certbot:
_bin: null _bin: certbot
_desc: >- _desc: >-
[Certbot](https://certbot.eff.org/) is part of EFFs effort to encrypt the entire Internet. Secure communication over the Web relies on HTTPS, which requires the use of a digital certificate that lets browsers verify the identity of web servers (e.g., is that really google.com?). Web servers obtain their certificates from trusted third parties called certificate authorities (CAs). Certbot is an easy-to-use client that fetches a certificate from [Lets Encrypt](https://letsencrypt.org/)—an [Certbot](https://certbot.eff.org/) is part of EFFs effort to encrypt the entire Internet. Secure communication over the Web relies on HTTPS, which requires the use of a digital certificate that lets browsers verify the identity of web servers (e.g., is that really google.com?). Web servers obtain their certificates from trusted third parties called certificate authorities (CAs). Certbot is an easy-to-use client that fetches a certificate from [Lets Encrypt](https://letsencrypt.org/)—an
open certificate authority launched by the EFF, Mozilla, and others—and deploys it to a web server. open certificate authority launched by the EFF, Mozilla, and others—and deploys it to a web server.
@ -797,8 +797,12 @@ softwarePackages:
_github: https://github.com/certbot/certbot _github: https://github.com/certbot/certbot
_home: https://certbot.eff.org/ _home: https://certbot.eff.org/
_name: CertBot _name: CertBot
_service: null _service: true
_snapClassic: true
ansible: professormanhattan.certbot ansible: professormanhattan.certbot
brew: certbot
port: certbot
snap: certbot
cfssl: cfssl:
_bin: null _bin: null
_desc: null _desc: null
@ -2629,13 +2633,13 @@ softwarePackages:
scoop: glow scoop: glow
yay: glow yay: glow
glusterfs: glusterfs:
_bin: null _bin: gluster
_desc: '[Gluster](https://www.gluster.org/) is a free and open source software scalable network filesystem. Gluster is a software defined distributed storage that can scale to several petabytes. It provides interfaces for object, block and file storage.' _desc: '[Gluster](https://www.gluster.org/) is a free and open source software scalable network filesystem. Gluster is a software defined distributed storage that can scale to several petabytes. It provides interfaces for object, block and file storage.'
_docs: null _docs: https://docs.gluster.org/en/latest/
_github: null _github: https://github.com/gluster/glusterfs
_home: null _home: https://www.gluster.org/
_name: GlusterFS _name: GlusterFS
_service: null _service: true
ansible: professormanhattan.glusterfs ansible: professormanhattan.glusterfs
dnf: glusterfs-server dnf: glusterfs-server
pacman: glusterfs pacman: glusterfs
@ -4331,14 +4335,21 @@ softwarePackages:
_service: null _service: null
ansible: professormanhattan.nextcloud ansible: professormanhattan.nextcloud
nginx: nginx:
_bin: null _bin: nginx
_desc: It also generates sites-enabled proxies using YML configurations. Easter eggs included. [Nginx](https://www.nginx.com/), stylized as NGINX, nginx or NginX, is a web server that can also be used as a reverse proxy, load balancer, mail proxy and HTTP cache. The software was created by Igor Sysoev and publicly released in 2004. Nginx is free and open-source software, released under the terms of the 2-clause BSD license. _desc: It also generates sites-enabled proxies using YML configurations. Easter eggs included. [Nginx](https://www.nginx.com/), stylized as NGINX, nginx or NginX, is a web server that can also be used as a reverse proxy, load balancer, mail proxy and HTTP cache. The software was created by Igor Sysoev and publicly released in 2004. Nginx is free and open-source software, released under the terms of the 2-clause BSD license.
_docs: https://nginx.org/en/docs/ _docs: https://nginx.org/en/docs/
_github: https://github.com/nginx/nginx _github: https://github.com/nginx/nginx
_home: https://nginx.org/ _home: https://nginx.org/
_name: NGINX _name: NGINX
_service: null _service: true
ansible: professormanhattan.nginx ansible: professormanhattan.nginx
apt: nginx
brew: nginx
choco: nginx
dnf: nginx
pacman: nginx
port: nginx
scoop: nginx
ngrok: ngrok:
_bin: null _bin: null
_desc: '[Ngrok](https://ngrok.com/) exposes local servers behind NATs and firewalls to the public internet over secure tunnels. Ngrok also provides a real-time web UI where you can introspect all HTTP traffic running over your tunnels. You can replay any request against your tunnels with one click. The main feature is the ability to generate an internet-accessible URL that directs traffic to your local web server even if it is behind a firewall or proxy.' _desc: '[Ngrok](https://ngrok.com/) exposes local servers behind NATs and firewalls to the public internet over secure tunnels. Ngrok also provides a real-time web UI where you can introspect all HTTP traffic running over your tunnels. You can replay any request against your tunnels with one click. The main feature is the ability to generate an internet-accessible URL that directs traffic to your local web server even if it is behind a firewall or proxy.'
@ -5593,7 +5604,8 @@ softwarePackages:
_home: https://sdkman.io/ _home: https://sdkman.io/
_name: SDKMAN _name: SDKMAN
_service: null _service: null
ansible: professormanhattan.sdkman _note: SDKMan is installed via .chezmoiscripts
# ansible: professormanhattan.sdkman
seconion: seconion:
_bin: null _bin: null
_desc: '[Security Onion](https://securityonionsolutions.com/) is a free and open source Linux distribution for threat hunting, enterprise security monitoring, and log management. It includes Elasticsearch, Logstash, Kibana, Snort, Suricata, Bro, Wazuh, Sguil, Squert, NetworkMiner, and many other security tools. The easy-to-use Setup wizard allows you to build an army of distributed sensors for your enterprise in minutes! This role takes it a step further and automates the whole setup process.' _desc: '[Security Onion](https://securityonionsolutions.com/) is a free and open source Linux distribution for threat hunting, enterprise security monitoring, and log management. It includes Elasticsearch, Logstash, Kibana, Snort, Suricata, Bro, Wazuh, Sguil, Squert, NetworkMiner, and many other security tools. The easy-to-use Setup wizard allows you to build an army of distributed sensors for your enterprise in minutes! This role takes it a step further and automates the whole setup process.'
@ -6242,14 +6254,21 @@ softwarePackages:
choco: tabby choco: tabby
github: github.com/Eugeny/tabby github: github.com/Eugeny/tabby
tailscale: tailscale:
_bin: null _bin: tailscale
_desc: '[Tailscale](https://tailscale.com/) lets you easily manage access to private resources, quickly SSH into devices on your network, and work securely from anywhere in the world.' _desc: '[Tailscale](https://tailscale.com/) lets you easily manage access to private resources, quickly SSH into devices on your network, and work securely from anywhere in the world.'
_docs: https://tailscale.com/kb/ _docs: https://tailscale.com/kb/
_github: https://github.com/tailscale/tailscale _github: https://github.com/tailscale/tailscale
_home: https://tailscale.com/ _home: https://tailscale.com/
_name: Tailscale _name: Tailscale
_service: null _post: sudo tailscale up
_service: true
_systemd:pacman: tailscaled
ansible: professormanhattan.tailscale ansible: professormanhattan.tailscale
brew: tailscale
cask: tailscale
choco: tailscale
pacman: tailscale
port: tailscale
task: task:
_bin: task _bin: task
_desc: A task runner / simpler Make alternative written in Go _desc: A task runner / simpler Make alternative written in Go
@ -6608,16 +6627,23 @@ softwarePackages:
_service: null _service: null
'cargo:': upt 'cargo:': upt
upx: upx:
_bin: null _bin: upx
_desc: '[UPX](https://upx.github.io/) is an advanced executable file compressor. UPX will typically reduce the file size of programs and DLLs by around 50%-70%, thus reducing disk space, network load times, download times and other distribution and storage costs. It supports compressing a wide variety of binary-like files. Surprisingly, it even compresses executables better than WinZip. Best of all, it is free and open source.' _desc: '[UPX](https://upx.github.io/) is an advanced executable file compressor. UPX will typically reduce the file size of programs and DLLs by around 50%-70%, thus reducing disk space, network load times, download times and other distribution and storage costs. It supports compressing a wide variety of binary-like files. Surprisingly, it even compresses executables better than WinZip. Best of all, it is free and open source.'
_docs: null _docs: https://github.com/upx/upx
_github: null _github: https://github.com/upx/upx
_home: null _home: https://upx.github.io/
_name: UPX _name: UPX
_service: null _service: false
ansible: professormanhattan.upx ansible: professormanhattan.upx
apt: upx
brew: upx
choco: upx
dnf: upx
pacman: upx
port: upx
scoop: upx
vagrant: vagrant:
_bin: null _bin: vagrant
_desc: '[Vagrant](https://www.vagrantup.com/) is an open-source software product for building and maintaining portable virtual software development environments (e.g., for VirtualBox, KVM, Hyper-V, Docker containers, VMware, and AWS).' _desc: '[Vagrant](https://www.vagrantup.com/) is an open-source software product for building and maintaining portable virtual software development environments (e.g., for VirtualBox, KVM, Hyper-V, Docker containers, VMware, and AWS).'
_docs: https://www.vagrantup.com/docs _docs: https://www.vagrantup.com/docs
_github: https://github.com/hashicorp/vagrant _github: https://github.com/hashicorp/vagrant
@ -6958,32 +6984,36 @@ softwarePackages:
_desc: >- _desc: >-
[Windows ADK](https://www.microsoft.com/en-us/windows-server/windows-admin-center) was unveiled by Microsoft on September 14, 2017 as the necessary evolution of the Windows Server graphical user interface. Windows ADK offers a flexible, locally-deployed, browser-based management platform and tools. The idea behind this project is to help simplify the management of servers by placing a majority of the frequently referenced tools used by system administrators in one spot. You can run it on [Windows ADK](https://www.microsoft.com/en-us/windows-server/windows-admin-center) was unveiled by Microsoft on September 14, 2017 as the necessary evolution of the Windows Server graphical user interface. Windows ADK offers a flexible, locally-deployed, browser-based management platform and tools. The idea behind this project is to help simplify the management of servers by placing a majority of the frequently referenced tools used by system administrators in one spot. You can run it on
both Windows 10 and Windows Server. both Windows 10 and Windows Server.
_docs: null _docs: https://learn.microsoft.com/en-us/windows-hardware/get-started/adk-install
_github: null _github: false
_home: null _home: https://learn.microsoft.com/en-us/windows-hardware/get-started/adk-install
_name: Windows ADK _name: Windows ADK
_service: null _service: null
ansible: professormanhattan.windowsadk ansible:windows: professormanhattan.windowsadk
choco: windows-adk
windows-admin-center: windows-admin-center:
_bin: null _bin: null
_desc: >- _desc: >-
[Windows Admin Center](https://www.microsoft.com/en-us/windows-server/windows-admin-center) was unveiled by Microsoft on September 14, 2017 as the necessary evolution of the Windows Server graphical user interface. Windows Admin Center offers a flexible, locally-deployed, browser-based management platform and tools. The idea behind this project is to help simplify the management of servers by placing a majority of the frequently referenced tools used by system administrators in one spot. You [Windows Admin Center](https://www.microsoft.com/en-us/windows-server/windows-admin-center) was unveiled by Microsoft on September 14, 2017 as the necessary evolution of the Windows Server graphical user interface. Windows Admin Center offers a flexible, locally-deployed, browser-based management platform and tools. The idea behind this project is to help simplify the management of servers by placing a majority of the frequently referenced tools used by system administrators in one spot. You
can run it on both Windows 10 and Windows Server. can run it on both Windows 10 and Windows Server.
_docs: null _docs: https://github.com/MicrosoftDocs/windowsserverdocs/blob/main/WindowsServerDocs/manage/windows-admin-center/overview.md
_github: null _github: false
_home: null _home: https://www.microsoft.com/en-us/windows-server/windows-admin-center
_name: Windows Admin Center _name: Windows Admin Center
_service: null _service: null
ansible: professormanhattan.windowsadmincenter ansible:windows: professormanhattan.windowsadmincenter
choco: windows-admin-center
windows-power-toys: windows-power-toys:
_bin: null _bin: null
_desc: '[Microsoft PowerToys](https://docs.microsoft.com/en-us/windows/powertoys/) is a set of utilities for Windows power-users to tune and streamline their Windows 10 experience for greater productivity. It includes tools like a Color Picker, File Explorer add-ons, Keyboard Manager, Shortcut Guide, and more.' _desc: '[Microsoft PowerToys](https://docs.microsoft.com/en-us/windows/powertoys/) is a set of utilities for Windows power-users to tune and streamline their Windows 10 experience for greater productivity. It includes tools like a Color Picker, File Explorer add-ons, Keyboard Manager, Shortcut Guide, and more.'
_docs: null _docs: https://learn.microsoft.com/en-us/windows/powertoys/
_github: null _github: https://github.com/microsoft/PowerToys
_home: null _home: https://learn.microsoft.com/en-us/windows/powertoys/
_name: Microsoft PowerToys _name: Microsoft PowerToys
_service: null _service: null
ansible: professormanhattan.windowspowertoys ansible:windows: professormanhattan.windowspowertoys
choco: powertoys
scoop: powertoys
winrm-cli: winrm-cli:
_bin: null _bin: null
_desc: Command-line tool to remotely execute commands on Windows machines through WinRM _desc: Command-line tool to remotely execute commands on Windows machines through WinRM