Skip to content

feat(brew): Automatically install and maintain brew package list (#347)#348

Closed
mecattaf wants to merge 1 commit intoblue-build:mainfrom
mecattaf:brew-improvement
Closed

feat(brew): Automatically install and maintain brew package list (#347)#348
mecattaf wants to merge 1 commit intoblue-build:mainfrom
mecattaf:brew-improvement

Conversation

@mecattaf
Copy link
Contributor

Let me know if you want me to make any changes, to comply with the coding standards of the modules project!
Corresponds to #347

Thanks,
T

Copy link
Collaborator

@fiftydinar fiftydinar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some initial thoughts before fully testing this

if [[ -n "${INSTALL_PACKAGES}" ]]; then
echo "install:" > /usr/share/bluebuild/brew/repo-info.yml
echo "${INSTALL_PACKAGES}" | sed 's/^/ - /' >> /usr/share/bluebuild/brew/repo-info.yml
echo "The following Brew packages will be installed when the system is live:"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
echo "The following Brew packages will be installed when the system is live:"
echo "The following Brew packages will be installed when system is booted:"

Description=Setup Brew Packages
After=brew-setup.service
Requires=brew-setup.service
ConditionPathExists=!/var/lib/brew-packages-setup.stamp
Copy link
Collaborator

@fiftydinar fiftydinar Oct 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This condition makes this execute only once.

It should execute every boot, to install packages from updated install list over time. If there are no packages, it will just say Package \$package is already installed.

To make logs more sane in this scenario (when there are no new packages to install),
instead of printing this echo for every package, it should print once: Installed packages are up-to-date with install list, no changes need to be done

Comment on lines +295 to +296
# Write brew-packages-setup script
cat > /usr/bin/brew-packages-setup <<EOF
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be just a file in the module's directory that is cp'd in place. Having it inline doesn't work with syntax highlighting and shellcheck.

@mecattaf
Copy link
Contributor Author

mecattaf commented Dec 5, 2024

FYI I will not be working on this module further because I have found that the only program offered by homebrew (ollama) runs slower than when installed using other methods. Feel free to close, or to keep open for another user to fix.
Thanks,
T

@xynydev xynydev added the state: pending Pending requirements, dependencies, data, or more information. label Dec 6, 2024
@mecattaf mecattaf closed this by deleting the head repository Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

state: pending Pending requirements, dependencies, data, or more information.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants