mirror of https://codeberg.org/glenneth/stash.git
4.1 KiB
4.1 KiB
Stash User Guide
Table of Contents
Installation
Using Guix
The recommended way to install Stash is using the Guix package manager:
# Install from local package definition
guix package --install-from-file=minimal-package.scm
After installation, the stash executable will be available in your Guix profile at ~/.guix-profile/bin/stash.
Manual Installation
If you're not using Guix, you can install Stash manually:
-
Install prerequisites:
# Debian/Ubuntu sudo apt-get install guile-3.0 # Fedora sudo dnf install guile30 # Arch Linux sudo pacman -S guile -
Clone and set up the repository:
git clone https://github.com/yourusername/stash.git cd stash mkdir -p ~/.guile.d/site/3.0 ln -s $(pwd)/modules/stash ~/.guile.d/site/3.0/
Shell Configuration
Fish Shell
-
Add to
~/.config/fish/config.fish:# Guix environment setup set -gx GUIX_PROFILE $HOME/.guix-profile set -gx PATH $GUIX_PROFILE/bin $PATH # Load Guix environment variables if test -f $GUIX_PROFILE/etc/profile for line in (cat $GUIX_PROFILE/etc/profile | grep '^export' | string replace 'export ' '') set var (string split '=' $line) set -gx $var[1] (eval echo $var[2]) end end -
Alternative method using symlink:
ln -sf ~/.guix-profile/bin/stash ~/.local/bin/stash
Bash Shell
Add to ~/.bashrc:
# Guix environment setup
export GUIX_PROFILE="$HOME/.guix-profile"
if [ -f "$GUIX_PROFILE/etc/profile" ]; then
. "$GUIX_PROFILE/etc/profile"
fi
Zsh Shell
Add to ~/.zshrc:
# Guix environment setup
export GUIX_PROFILE="$HOME/.guix-profile"
if [ -f "$GUIX_PROFILE/etc/profile" ]; then
. "$GUIX_PROFILE/etc/profile"
fi
Basic Usage
-
Simple file stashing:
# Move a directory to backup location stash -s ~/Documents/notes -t ~/backup/notes -
Recursive stashing:
# Move entire config directory stash -s ~/.config -t ~/.dotfiles/config -r -
Interactive mode:
# Let stash prompt for target location stash -s ~/Pictures -i
Advanced Features
-
Ignore Patterns
- Create
.stashignorein source directory - Add patterns similar to
.gitignore
*.tmp .DS_Store node_modules/ - Create
-
Recursive Mode
- Use
-rflag for entire directory trees - Preserves directory structure
- Creates symlinks for all subdirectories
- Use
-
Conflict Resolution
- Automatically detects existing files/symlinks
- Interactive prompts for resolution
- Options to skip, replace, or backup
Configuration
-
Environment Variables
GUILE_AUTO_COMPILE=0: Disable auto-compilationGUILE_LOAD_PATH: Add custom module pathsGUIX_PROFILE: Set Guix profile location
-
Global Configuration
- System-wide ignore patterns in
/etc/stash/ignore - User-specific patterns in
~/.config/stash/ignore
- System-wide ignore patterns in
Troubleshooting
-
Command Not Found
- Verify Guix profile is sourced correctly
- Check PATH includes
~/.guix-profile/bin - Try creating symlink in
~/.local/bin
-
Module Loading Issues
- Ensure GUILE_LOAD_PATH includes module directory
- Check module permissions and ownership
- Verify Guile version compatibility
-
Permission Errors
- Check file/directory permissions
- Ensure write access to target location
- Verify symlink creation permissions
-
Common Warnings
- "canonicalize-path override": Normal, can be ignored
- "auto-compilation enabled": Set GUILE_AUTO_COMPILE=0
For more information or to report issues, visit: https://codeberg.org/glenneth/stash