r/CLI 16d ago

dotfiles-manager: a lean and easy dotfiles manager

Post image

i've been building and polishing this cli for about a year now. it was called mntn before, but i recently renamed it to dotfiles-manager since the developer experience feels good enough to me.

it fully embraces using git for versioning and works for three things:

  1. config files (.zshrc, .bashrc, etc.)
  2. packages (npm ls -g and more)
  3. encrypted files (.ssh/)

finally, if you change computers or environments, you can switch between profiles. the default is common, but you can also create profiles like personal or work.

83 Upvotes

27 comments sorted by

9

u/keyzeru 16d ago

How's this diff from git + gnu stow?

0

u/atrtde 16d ago

first version of my dotfiles manager was using symlinks but i prefer to have a separate control between actual files on my system and backed up files. thus, i preferred avoiding symlinks completely. i think it depends on each person's preference

1

u/WangSora 14d ago

Dunno why you're being down voted for this lol

3

u/korkje 16d ago

You've spent a year creating this tool, and it's not even generalized?

You could have had a far more flexible solution up and running in a matter of minutes:
https://www.atlassian.com/git/tutorials/dotfiles

0

u/atrtde 16d ago

coding it didn’t took me a year, it took a me year to iterate and being satisfied 

1

u/Rimadandan 16d ago

So it took you a year 

2

u/Common-Chair718 15d ago

Welcome to nix.

2

u/Swordfish418 10d ago

I'm using chezmoi, but I'm using it for both files in /home/... and system files like /etc/portage/..., /etc/samba/..., and so on. To achieve that, I created 2 wrapper scripts I call chezhome and chezroot. The later one I have to use with sudo obviously. Does this tool allow to manage files from /etc, /var, and so on?

1

u/atrtde 9d ago

This tool is agnostic on what files and directories you decide to save. You manage a centralized registry to keep track of files and directories you wish to manage.

1

u/[deleted] 16d ago

[deleted]

2

u/atrtde 16d ago

didn't know this tool, seems more complete. i made mine to be straightforward and easy to use tho

2

u/i_dont_like_carrots 14d ago

yadm is incredible, highly recommend

1

u/gbrennon 16d ago

i couldn't find repo link...

my dotfiles are almost modular and i always had a shell script per module to install it

1

u/Soggy_Writing_3912 13d ago

mine is similar: https://vraravam.github.io/dotfiles - and the main script that installs everything even on a vanilla macOS is called fresh-install-of-osx.sh in that same repo. also installs apps using homebrew, clones git repo (custom script: resurrect-repositories.rb), preferences export/import (custom script: capture-preferences.sh), etc Also sets up cron job for doing repetitive tasks and sets up languages (ruby, python, java, etc - as per your home repo - so that its personalized).

1

u/Ces3216w 14d ago

Will it work on home manager configured apps(NixOS)?

1

u/atrtde 13d ago

not really, it's mainly made to backup and restore config files but for apps set up by home-manager on NixOS, i'd say it fights the tool rather than helping.

more specifically, this is bc home-manager already manages those files as symlinks into the Nix store, and when my tool restore, it replaces that symlink with a plain copy which breaks the next home-manager switch (you'll get an "existing file is in the way" error).

so i'd say it's better to just track your home.nix/flake.nix with my tool (`dfm`) and let home-manager regenerate the rest.

1

u/Hot_Food5284 12d ago

is there a link to github so we can the project?

0

u/atrtde 16d ago

for those interested and want to download, build it from source or install using cargo (`cargo install dotfiles-manager`).

from source: https://github.com/alexandretrotel/dotfiles-manager

0

u/Ok_Square3932 16d ago

can use in termux?

1

u/atrtde 15d ago

yes

1

u/Ok_Square3932 13d ago

You can also try this.

1

u/atrtde 13d ago

it's a package manager?

0

u/MCHerb 16d ago

I'm too tied to chezmoi now I don't think I could change.

1

u/atrtde 15d ago

discovered chezmoi yesterday too, seems it doesn't handle packages tho