A simple dotfile manager and package manager wrapper for Linux/macOS
Define symbolic links for multiple os profiles, and install packages from multiple package managers like
| Package Manager | Icon |
|---|---|
| nix-env | 🧪 |
| brew | 🍺 |
| apt | 🐧 |
| dnf | 🔧 |
| flatpak | 📦 |
| snap | 📦 |
[!WARN] still testing package manager wrapper configurations may not work will all managers
stow is great for symlinking dotfiles, but it doesn't help manage your system or user packages.
Meanwhile, Nix Home Manager does this — but if you're not on NixOS, things can get overly complex.
I just wanted a simple tool to:
- ✅ Link dotfiles
- ✅ Install packages from any package manager
So I made shm — a lightweight CLI tool that uses YAML configuration to initialize your dev environment in seconds.
Run the following installation script
curl -sSfL https://raw.githubusercontent.com/DavidRR-F/shm/main/install.sh | bash[!HINT] This script installs the executable in your
~/.local/binby default to remain user scoped
For examples, you can view my personal shm configurations
Create your shm configuration in your dotfiles directory
.shm/
├── base.yml
├── <profile>.yml
└── managers/
└── <manager>.yml| File/Directory | Description |
|---|---|
| .shm/base.yml | base shm configuration for common configurations between os's or single configuration (Can be empty) |
| .shm/.yml | additional profiles configurations that can be added to base configuration |
| .shm/managers/.yml | manager object configuration defines for package managers |
You can define symbolic link definitions in your base.yml or <profile>.yml
links:
- src: ~/.dotfiles/.bashrc
dest: ~/.bashrc
- src: ~/.dotfiles/myscript.sh
dest: ~/.local/bin/myscript
exe: true # makes file executeSimply run shm on your dotfile base directory to apply the links in your base.yml
shm ~/dotfiles/pathIn your managers directory you can define manager yaml object
# package manager name (must match file name and be executable)
name: nix-env
command: ["nix-env"]
# arguments for install command
args: ["-iA"]
# Nested commands will be invoked if package manager not already installed
install:
# package manager installation command
pre: ["sh", "<(curl -L https://nixos.org/nix/install)", "--daemon"]
# commands to run after package manager installation
post: [".", "/etc/profile.d/nix.sh"]
# list of packages to install
packages:
- nixpkgs.starship
- nixpkgs.lazygitYou can then add the manager(s) references to your base.yml or <profile>.yml configurations
managers:
- nix-envBy default, only links are applied when running shm, add the install-packages flag to additionally defined install packages
shm ~/dotfiles/path --install-packagesYou are able do define profile files in your .shm configuration
Example: .shm/mac.yml
links:
- src: ~/.dotfiles/lazygit
dest: ~/Applications/Library Support/lazygit
managers:
- brewWhen running shm you can specify a profile and those configuration will be added to your base configuration
shm ~/dotfiles/path --profile mac --install-packagesYou can preview what shm will do without making changes using --dry-run.
shm ~/dotfiles/path -i -p mac --dry-run