Crates.io | new-stow |
lib.rs | new-stow |
version | 0.1.6 |
source | src |
created_at | 2022-12-24 16:31:28.793463 |
updated_at | 2023-08-15 00:13:31.242686 |
description | Symlink farm manager with links defined in a stowfile |
homepage | https://github.com/adam-gaia/new-stow |
repository | https://github.com/adam-gaia/new-stow |
max_upload_size | |
id | 744997 |
size | 70,142 |
New Stow (or nstow
) is a symlink farm manager that aims to superset[^1] GNU Stow (or stow
).
[^1] See the comparison section below.
The package new-stow
provies a binary named nstow
.
cargo install new-stow
TODO
nstow --stow
nstow --unstow
./examples/exec
for an example./examples/dotfiles
for an example on using nstow
to manage dotfilesnstow --help
nstow
searches the working directory for a stowfile
.
Stowfiles define a set of sources and links.
---
vars:
# Variables may be defined for use in a src or link path
- THIS_IS_A_VAR=var_value
# Additionally, environment variables are inherrited
stow:
- src: some_example_file
links:
- ${HOME}/${THIS_IS_A_VAR}/link_it_here # One source file may be linked to many places
- ${HOME}/some/nested/dir/link_it_here_too # Link's parent directories are created if they do not exist
- src: alacritty.yml
links:
# Example of Stowfile using an env var not defined in the `var` section
- "${XDG_CONFIG_HOME}/alacritty/alacritty.yaml"
# Source files may be arbitrarily nested in directories
- bash:
- src: bashrc
links:
- "${HOME}/.bashrc"
- src: bash_profile
links:
- "${HOME}/.bash_profile"
# The source can have any name, even something unrelated to the link's name
- src: readline
links:
- "${HOME}/.inputrc"
The stowfile above will result in links
nstow
aims to superset (most) of stow
's features [^2]
GNU Stow Feature | New Stow | Comments |
---|---|---|
--no | ✔ | |
--dir | ✔ | |
--stow | ✔ | |
--delete | ✔ | |
--restow | ✔ | |
--adopt | planned | |
--no-folding | planned | |
--ignore=REGEX | ✔ | |
--defer=REGEX | ||
--override=REGEX | ✔ | |
--backup=REGEX | ✔ | |
--dotfiles | planned |
Note that stow's regexes may match the beginning or end of a file while nstow regexes match any part.
TODO: do we want full feature parity with stow and the ability to link without a stowfile?
[^2]GNU Stow options are current with 2.3.1
, the latest at the time of writing.
Dependencies are managed with a Nix Flake. While we reccomend using Nix, you can ignore it and work with Cargo directly.
The toolchain
list in flake.nix
will specify any extra development dependencies.
./run-tests
runs the script tests/integration-tests
in a container so that we can create/delete symlinks with impunity.