diff --git a/home/.chezmoidata.yaml b/home/.chezmoidata.yaml index 34cb1faa..5fd3489a 100644 --- a/home/.chezmoidata.yaml +++ b/home/.chezmoidata.yaml @@ -860,6 +860,85 @@ softwareGroups: - endlessh - fail2ban - openssh-server + _General-Purpose-Server: &_General-Purpose-Server + - *CLI + - *Database + - *Essentials + - *File-System + - *NGINX + - *PHP + - *Python + - *Ruby + - *SSH + - *Sys-Admin + - *Transfer + - *Virtualization + - ansifilter + - aqua + - astronvim + - automake + - autorestic + - bat + - bfg + - boringtun + - clamav + - cloudflared + - cmake + - cockpit + - docker + - dotnet + - elastic-agent + - envchain + - etcd + - exiftool + - expect + - ffmpeg + - fury + - git + - git-extras + - git-filter-repo + - git-fuzzy + - git-lfs + - git-secret + - git-subrepo + - gitlab-runner + - gitomatic + - glusterfs + - glusterfs + - go + - gomplate + - goofys + - gradle + - imagemagick + - java + - libimobiledevice + - nebula + - netdata + - openssh-server + - pm2 + - rclone + - restic + - rkhunter + - rust + - sake + - samba + - sftpgo + - sharp + - skate + - snapcraft + - solidity + - sqlite + - ssh-vault + - sshfs + - tailscale-client + - teller + - tinypng + - upx + - warp + - wazuh + - windows-adk + - windows-admin-center + - windows-power-toys _Basic-Desktop: &_Basic-Desktop - *_Basic - *Essentials-Desktop diff --git a/home/.chezmoiscripts/universal/run_onchange_after_51-samba.sh.tmpl b/home/.chezmoiscripts/universal/run_onchange_after_51-samba.sh.tmpl index 512d6e3e..6f94f6bf 100644 --- a/home/.chezmoiscripts/universal/run_onchange_after_51-samba.sh.tmpl +++ b/home/.chezmoiscripts/universal/run_onchange_after_51-samba.sh.tmpl @@ -18,7 +18,7 @@ # # If CloudFlare R2 credentials are provided, Samba is configured to store its shared files in the Rclone mounts so that your # Samba shares are synchronized to the S3 buckets. If not, new folders are created. Either way, the folder / symlink that the -# shares host data from are stored at `/mnt/samba-private` and `/mnt/samba-public`. +# shares host data from are stored at `/mnt/share-private` and `/mnt/share-public` (*Note: Different paths are used on macOS*). # # 1. The **public** share (named "Public") can be accessed by anyone (including write permissions with the default settings) # 2. The **private** share (named "Private") can be accessed by specifying the PAM credentials of anyone who has an account that is included in the `sambausers` group @@ -54,26 +54,43 @@ ### Configure Samba server if command -v smbd > /dev/null; then - ### Ensure private Samba directory / symlink exists - if [ -d /mnt/s3-private ] && [ ! -d /mnt/samba-private ]; then - sudo ln -s /mnt/s3-private /mnt/samba-private + ### Define share locations + if [ -d /Applications ] && [ -d /System ]; then + ### macOS does not have `/mnt` folder so use `/Volumes` location + MNT_FOLDER='Volumes' else - sudo mkdir -p /mnt/samba-private + MNT_FOLDER='mnt' + fi + PRIVATE_CLOUD="/$MNT_FOLDER/Cloud (Private)" + PUBLIC_CLOUD="/$MNT_FOLDER/Cloud (Public)" + PRIVATE_SHARE="/$MNT_FOLDER/Network Share (Private)" + PUBLIC_SHARE="/$MNT_FOLDER/Network Share (Public)" + + ### Ensure private Samba directory / symlink exists + if [ -d "$PRIVATE_CLOUD" ] && [ ! -d "$PRIVATE_SHARE" ]; then + sudo ln -s "$PRIVATE_CLOUD" "$PRIVATE_SHARE" + else + sudo mkdir -p "$PRIVATE_SHARE" fi ### Ensure public Samba directory / symlink exists - if [ -d /mnt/s3-public ] && [ ! -d /mnt/samba-public ]; then - sudo ln -s /mnt/s3-public /mnt/samba-public + if [ -d "$PUBLIC_CLOUD" ] && [ ! -d "$PUBLIC_SHARE" ]; then + sudo ln -s "$PUBLIC_CLOUD" "$PUBLIC_SHARE" else - sudo mkdir -p /mnt/samba-public + sudo mkdir -p "$PUBLIC_SHARE" fi ### Copy the Samba server configuration file - logg info "Copying Samba server configuration to /etc/samba/smb.conf" - sudo cp -f "${XDG_CONFIG_HOME:-$HOME/.config}/samba/config" "/etc/samba/smb.conf" + if [ -d /Applications ] && [ -d /System ]; then + logg warn 'TODO Add logic that applies the Samba configuration for macOS' + else + logg info "Copying Samba server configuration to /etc/samba/smb.conf" + sudo cp -f "${XDG_CONFIG_HOME:-$HOME/.config}/samba/config" "/etc/samba/smb.conf" - ### Reload configuration file changes - smbcontrol smbd reload-config + ### Reload configuration file changes + logg info 'Reloading the `smbd` config' + smbcontrol smbd reload-config + fi else logg info "Samba server is not installed" fi diff --git a/home/.chezmoiscripts/universal/run_onchange_after_95-bootstrap-zsh-plugins.sh.tmpl b/home/.chezmoiscripts/universal/run_onchange_after_95-bootstrap-zsh-plugins.sh.tmpl index 9469c9b7..3ca45862 100644 --- a/home/.chezmoiscripts/universal/run_onchange_after_95-bootstrap-zsh-plugins.sh.tmpl +++ b/home/.chezmoiscripts/universal/run_onchange_after_95-bootstrap-zsh-plugins.sh.tmpl @@ -7,7 +7,7 @@ # It does this by invoking ZSH in the background during the provisioning process so that "first-run" tasks such # as cache-building are handled ahead of time. -# .zshrc hash: {{ include (joinPath .chezmoi.homeDir ".zshrc")| sha256sum }} +# .zshrc hash: {{ include (joinPath .chezmoi.homeDir ".zshrc") | sha256sum }} {{ includeTemplate "universal/profile" }} {{ includeTemplate "universal/logg" }} diff --git a/home/dot_config/rclone/merge_private_rclone.conf.tmpl b/home/dot_config/rclone/merge_private_rclone.conf.tmpl index b2bcf995..a0a19544 100644 --- a/home/dot_config/rclone/merge_private_rclone.conf.tmpl +++ b/home/dot_config/rclone/merge_private_rclone.conf.tmpl @@ -16,13 +16,13 @@ fi tee -a "$CONFIG_FILE" > /dev/null < /dev/null; then if [ -z "$SOFTWARE_GROUP" ]; then logg prompt 'Select the software group you would like to install. If your environment is a macOS, Windows, or environment with the DISPLAY environment variable then desktop software will be installed too. The software groups are in the '"${XDG_CONFIG_HOME:-$HOME/.config}/chezmoi/chezmoi.yaml"' file.' - SOFTWARE_GROUP="$(gum choose "Basic" "Standard" "Full")" + SOFTWARE_GROUP="$(gum choose "General-Purpose-Server" "Basic" "Standard" "Full")" export SOFTWARE_GROUP fi else