like make, but for symlinks
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Hazel Levine 7f66b0ff11 rm nix store symlink 5 months ago
nix nix build 5 months ago
src add delink functionality 5 months ago
.envrc nix build 5 months ago
.gitignore rm nix store symlink 5 months ago
Cargo.toml add delink functionality 5 months ago
LICENSE init linkfile parser w/ glob 8 months ago
README.org add delink functionality 5 months ago
default.nix nix build 5 months ago
shell.nix nix build 5 months ago

README.org

lake

Description

Like GNU stow, and also like make for dotfiles. In short, another symlink manager, because I'm not satisfied with any of the other ones.

Usage

In your main folder, have subdirectories:

 λ ~ ls etc
bin  bspwm  doom  Linkfile  zsh  README.md

Under each subdirectory:

 λ ~ ls etc/doom/
blog.org  config.org  init.el  nice.png

The Linkfile (or Lakefile) defines where you put your stuff. It follows the following (tentative) syntax, with the file on the left and the target directory on the right, and defaults to $HOME:

doom/config.org => .config/doom/

You can specify what filename you'd like to use, if they aren't the same:

zsh/zshrc => .zshrc

If you aren't using $HOME, you can specify a path:

udev/95-monitor-hotplug.rules => /etc/udev/rules.d/

You can also use glob syntax to grab all files:

bin/* => bin/

You can add empty lines anywhere, and comments with #.

To run the program, you can just run lake. To remove the links, you can run lake -r. Furthermore, the location of the Linkfile can depend on how you want to structure your dots. Just want to run lake? Put it in the root. Want to keep stuff program-specific? Put a Linkfile in each directory.

Building

If you're using the Nix package manager, just nix-build. Otherwise, cargo build --release.

Fair note that issues may arise when building with Nix, because the Nix build uses nightly rust due to a limitation in Naersk, a Rust build system for Nix. This'll be fixed soon enough.

Installation

Again, with Nix:

nix-env -i -f https://git.qtp2t.club/hazel/lake/archive/0.3.0.tar.gz

You can also use https://qtp2t.cachix.org to get prebuilt binaries for Linux.

Otherwise, just put the binary generated by cargo somewhere.

Tasks

TODO Support alternative stow locations via CLI

TODO More verbose parse errors

This one's hard on the merit that anyhow::Error ensures that the resultant error has static lifetime, but due to the nature of nom::IResult, this would make the input static, which is decidedly undesired behavior.