Crates.io | nstow |
lib.rs | nstow |
version | 0.2.1 |
source | src |
created_at | 2024-08-15 17:53:34.755332 |
updated_at | 2024-08-15 18:37:19.178612 |
description | [BROKEN] Cross-platform symlink farm manager with links defined in a stowfile |
homepage | https://codeberg.org/c0smic/nstow |
repository | https://codeberg.org/c0smic/nstow |
max_upload_size | |
id | 1339063 |
size | 72,271 |
BROKEN!
This crate is broken and may not be updated in the forseeable future.
Use at your own risk.
nstow
is a symlink farm manager that aims to superset[^1] GNU Stow (or stow
).
It is a clone of new-stow
with cross-platform compatiblity.
[^1] See the comparison section below.
The package nstow
provies a binary named nstow
.
cargo install nstow
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.