Earlier quoted context omitted.
Right, but when you unlink it from your home directory, the file still exists in the git repo. So there is a manual synchronization that must happen between the two directories.
> Right, but when you unlink it from your home directory, the file still exists in the git repo. That's a feature.
Using GNU Stow to manage your dotfiles (2012)
51–60 of 116 posts
Re: Using GNU Stow to manage your dotfiles (2012)
#52Earlier quoted context omitted.
> Right, but when you unlink it from your home directory, the file still exists in the git repo. That's a feature.
Not when you are looking for a workflow to make dealing with dotfiles faster and more painless. With the current (symlink based) setup, there is a hidden state you must hold in your head or else carefully inspect: the discrepancy between your git repo and your home directory. Maybe you forgot to link a dotfile, and that’s why your latest configuration doesn’t work. Ditto for unlinking a dotfile.
I did not use stow 2.x, but my understanding is that running stow -R will allow you to remove previous dangling symlinks (during the unstow) and add missing symlinks (during the restow). Effectively allowing you to only manage a single state: your git repository.
Re: Using GNU Stow to manage your dotfiles (2012)
#53Call me old fashioned but what's wrong with having a regular git repo anywhere you want with all of your dotfiles and them symlink those files to where they need to go? If you wanted to you could && a few symlinks and other commands into 1 copy / paste'able command to get up and running really quickly. It's also painless to manage secrets by sourcing in optional files. It also works nicely when you want files living…
Re: Using GNU Stow to manage your dotfiles (2012)
#54Environment variables and their defaults:
ZPKG_SRC = ~/.local/pkg
ZPKG_DST = ~/.local
ZPKG_DB = ~/.local/pkg/.db
It means that if you install anything from scratch, you have to `make install` (or the like, depending on the build system) it to, say, `~/.local/pkg/foo-1.0` and then run `zpkg link foo:1.0` to install (i.e. link) the "package".After that you just have to make sure you have (typically in your `~/.bash_profile` file):
- added `~/.local/bin` to your `PATH` environment variable, and
- added `~/.local/man` to your `MANPATH` environment variable
Seems to do the job. For help, read the source code or type `zpkg --help` which should be of tremendous help.
By the way, I have noticed that someone created a package manager with the same name, but its initial commit was in 2019, while this one's was in 2017.
It is written in OCaml, so you do need to have the OCaml compiler installed. I recommend doing it via `opam`, but your Linux distribution's package manager will suffice (simply `ocaml` on Arch Linux, for example). Run `make` to compile it, it will produce a working executable file.
Direct link to the source code: https://zolk3ri.name/cgit/zpkg/tree/src/zpkg.ml
If you find any bugs, report it via e-mail which can be found in the `LICENSE` file. I reported a bug before and it was fixed almost immediately. I suppose you can send pull requests or mention missing features, the creator seemed friendly to me.
---
The above is a modified version of an old comment of mine: https://news.ycombinator.com/item?id=24238587
---
To be frank, I forgot how it compares to GNU Stow because it was many years ago, but I did use GNU Stow prior to finding this program. All I remember is that it is way simpler, and it seemed to be perfect for my use case, no more and no less than what I needed. Maybe it works for you, too.
Re: Using GNU Stow to manage your dotfiles (2012)
#55Re: Using GNU Stow to manage your dotfiles (2012)
#561. Bare git repo in your home directory ($HOME/.files)
2. Alias for prefixing git commands ("env GIT_WORK_TREE=$HOME GIT_DIR=$HOME/.files")
3. Strict .gitignore file (that ignores all files by default)
Simple to add files: `h git add .vimrc`
Have this set up for myself. Works great https://github.com/tmm/dotfiles
Re: Using GNU Stow to manage your dotfiles (2012)
#57You don't need symlinks, setup scripts, etc. Try this: 1. Bare git repo in your home directory ($HOME/.files) 2. Alias for prefixing git commands ("env GIT_WORK_TREE=$HOME GIT_DIR=$HOME/.files") 3. Strict .gitignore file (that ignores all files by default) Simple to add files: `h git add .vimrc` Have this set up for myself. Works great https://github.com/tmm/dotfiles
Re: Using GNU Stow to manage your dotfiles (2012)
#58I have found that managing dotfiles is not enough. The dotfiles serve no purpose without the software that uses them. My method is to write small scripts, I call them setuplets, that install the software and then symlink the dotfile to its master that I manage in git. In the simplest case, it is just a two line script in a directory, but I have one for each program, and a tool to select which I run when setting up a…
Interesting! https://github.com/nix-community/home-manager uses Nix to solve this problem. It adds reproducibility and rollbacks but with the cost of learning the Nix DSL.
Re: Using GNU Stow to manage your dotfiles (2012)
#59Re: Using GNU Stow to manage your dotfiles (2012)
#60I have found that managing dotfiles is not enough. The dotfiles serve no purpose without the software that uses them. My method is to write small scripts, I call them setuplets, that install the software and then symlink the dotfile to its master that I manage in git. In the simplest case, it is just a two line script in a directory, but I have one for each program, and a tool to select which I run when setting up a…
Bonus: now even configuration files can be linked to the software that needs it; when you remove a software you also remove all the files related to it and there are no leftovers.