zimfw icon indicating copy to clipboard operation
zimfw copied to clipboard

zim for whole system

Open psztoch opened this issue 3 years ago • 5 comments

Update documentation how to deploy zim for whole system. It is important to develop a single standard.

zimrc should be placed in /etc/... Only root can manage module list and all other users can use zsh and downloaded modules.

Update should be default off if you have not got right to write.

Generated files shoud have o+rX rights.

psztoch avatar Nov 07 '22 11:11 psztoch

Bump; Would be nice to have this :)

therealresonix avatar May 25 '24 16:05 therealresonix

@ericbn

therealresonix avatar Jun 01 '24 14:06 therealresonix

@therealresonix you can contribute by describing a solution or by opening a pull request with a solution. Please be respectful and avoid adding comments that don't contribute to solving the problem described.

ericbn avatar Jun 01 '24 14:06 ericbn

What are we missing here in more detailed terms? I see:

  1. zimfw is not setting the +r flag to init.zsh and the deprecated login_init.zsh (FIXED for next release)
  2. zimfw update fails with generic error messages when user does not have write permissions
  3. running zimfw fails with the following if user sourced the init.zsh script from another user. Not sure what would be a better error message in this case.
    _zimfw_source_zimrc:source:245: no such file or directory: /Users/me/.zimrc
    

Additionally, I think these are fine:

  1. zimfw install fails with the following when user does not have write permissions:
    mkdir: /path/to/.zim/modules/newmodule: Permission denied
    
    or
    fatal: could not create work tree dir '/path/to/.zim/modules/newmodule': Permission denied
    
  2. zimfw upgrade fails with the following when user does not have write permissions:
    curl: (23) Failure writing output to destination
    
    or
    /path/to/.zim/zimfw.zsh.new.gz: Permission denied
    

Anything I'm missing here?

ericbn avatar Jun 01 '24 14:06 ericbn

Just released zimfw v1.14.0 with features that enabled having a system-wide installation.

The key points are:

  1. The "administrator" user will have the usual ~/.zshrc set up, with the exception that ZIM_HOME must be set to a path outside their HOME directory. You can use e.g. ZIM_HOME=/usr/local/opt/zim.
    ZIM_HOME=/usr/local/opt/zim
    # Download zimfw plugin manager if missing.
    if [[ ! -e ${ZIM_HOME}/zimfw.zsh ]]; then
      curl -fsSL --create-dirs -o ${ZIM_HOME}/zimfw.zsh \
          https://github.com/zimfw/zimfw/releases/latest/download/zimfw.zsh
    fi
    # Install missing modules and update ${ZIM_HOME}/init.zsh if missing or outdated.
    if [[ ! ${ZIM_HOME}/init.zsh -nt ${ZIM_CONFIG_FILE:-${ZDOTDIR:-${HOME}}/.zimrc} ]]; then
      source ${ZIM_HOME}/zimfw.zsh init -q
    fi
    # Initialize modules.
    source ${ZIM_HOME}/init.zsh
    
  2. Only the "administrator" user will have their ~/.zimrc to configure the zimfw plugin manager.
  3. Other users simply source the init.zsh script by adding this to their .zshrc:
    source /usr/local/opt/zim/init.zsh
    
  4. Other user must have read permission to ZIM_HOME.
  5. Other users cannot run the zimfw plugin manager.

ericbn avatar Jun 25 '24 17:06 ericbn