this post was submitted on 18 Oct 2023
70 points (93.8% liked)

Linux

47484 readers
1245 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 5 years ago
MODERATORS
 

I'm looking for recommendations for a dotfile manager - there are so many out there I've got a bit of options paralysis!

I'd like a system that can backup all my dotfiles - with version management - and, if I nuked my home directory, could restore them all for me with a simple command.

Thanks in advance for you suggestions!

top 50 comments
sorted by: hot top controversial new old
[–] Anticorp@lemmy.ml 33 points 11 months ago (2 children)

You guys manage your dot files? Huh!

Isn't every reinstall an opportunity for changes?

[–] pastermil@sh.itjust.works 5 points 11 months ago

You took the words right out of my mouth!

[–] Dirk@lemmy.ml 22 points 11 months ago

I version them with Git.

[–] cvf@kbin.social 20 points 11 months ago* (last edited 11 months ago) (2 children)

Home-manager on NixOs. It handles more than just dotfiles, as it also manages installed programs.

[–] saud@lemmy.ml 7 points 11 months ago

It works outside of NixOS too! Just need to have the nix package manager installed.

[–] velox_vulnus@lemmy.ml 2 points 11 months ago (5 children)

How do you manage configuration.nix? Can you share? I've not yet create a NixOS dotfile.

[–] yiliu@informis.land 4 points 11 months ago

Just so it's clear for everybody: Nix is a programming language, build system, and package manager. NixOS is a Linux distro built with (and upon) Nix. Home Manager is a dotfile and home management tool using Nix, allowing control of dotfiles, but also per-user software, systemd services, and more. You can use Home Manager in any distro, not just NixOS (but you do need to install Nix).

load more comments (4 replies)
[–] bitsplease@lemmy.ml 20 points 11 months ago (2 children)

Git and a script file that's basically just a ton of ln - s commands

I honestly don't think I've ever found myself wanting more

[–] faercol@lemmy.blahaj.zone 6 points 11 months ago

I do basically the same, but using GNU Stow instead of doing the ln myself

[–] humanplayer2@lemmy.ml 5 points 11 months ago

I did. I wanted more. I wanted ln -sf.

[–] adam@discuss.tchncs.de 18 points 11 months ago

I didn't even know that was a thing, I just keep it in a git repo

[–] stepanzak@iusearchlinux.fyi 18 points 11 months ago* (last edited 11 months ago) (1 children)

I'm extremely happy with chezmoi. It's very simple to use, but when you need more advanced features, it has them. It can do templates, ignoring and other stuff allowing you to easily manage dotfiles on multiple machines or even multiple operating systems (like windows on PC, Linux on laptop). Here is a comparison table of some dotfiles manager (it's on chezmoi's website, so it may be biased) Also here are my dotfiles (as a Linux user, I cannot resist the urge to share my dotfiles whenever I have the opportunity)

[–] nick@midwest.social 4 points 11 months ago

Chezmoi user here, love it.

[–] GustavoM@lemmy.world 11 points 11 months ago* (last edited 11 months ago)

cp -r to an external drive. And cp -r back in case something goes wrong.

I know, it's boring and no way "modern". But hey, it works and it does not require internet access!

[–] MigratingtoLemmy@lemmy.world 11 points 11 months ago
[–] conrad82@lemmy.world 10 points 11 months ago (1 children)

I used yadm for a while and liked it. It is a git wrapper that makes git'ing your home folder for config files less messy

https://yadm.io/

Now I don't care so much for keeping settings anymore and use mainly vanilla settings, therefore I stopped using it

[–] jelloeater85@lemmy.world 3 points 11 months ago

Second this, works great for multiple OSs as well, Linux and OSX in the same repo.

[–] gaetlep@lemmy.ml 9 points 11 months ago (1 children)
load more comments (1 replies)
[–] ad_on_is@lemmy.world 8 points 11 months ago (2 children)

nuking your home directory

Imho, in that case, you should look int a more proper backup strategy to restore all your files, not just your configs.

[–] qwesx@kbin.social 3 points 11 months ago

Or at the very least partition ~ as btrfs/zfs and do regular snapshots. The downside is, of course, that a rollback won't just roll back the dotfiles. But I guess if the scenario is "nuking [the] home directory" then that's probably not an issue.

[–] daddyjones@lemmy.world 3 points 11 months ago (1 children)

Thanks - yes I do have that, but I also wanted something specific to my dotfiles to make management and restoration a bit easier.

[–] ad_on_is@lemmy.world 3 points 11 months ago* (last edited 11 months ago)

I have a vorta backup, running on a regular basis for my home dir which has GBs of data.

Mounting and restoring files is literally a matter of seconds.

But if you want something that you can easily take with you, you can go with a symlink/git approach:

  • have a folder "configs"
  • move all your dotfiles thst have NO sensitive data like credentials into that folder
  • symlink them into their proper place
  • use GIT to track them and push them to a git repo

Once you need them somewhere else, it's just a git pull away... easy as that.

What I dislike about existing solutions, is they come with their own binaries, conventions, and stuff, but basically do almost the same... this is the "raw way" that will hold up on any system, and almost all of them have git.

[–] boblin@feddit.de 8 points 11 months ago

a git repository configured to ignore basically everything except the dotfiles. For my sway config I load configs from a symlinked folder, which points to a different config depending on the machine being configured.

[–] nothendev@sopuli.xyz 7 points 11 months ago

home-manager. a divine tool for ~~maniacs~~ Nix users that lets you do declarative dotfile management

[–] suprjami@lemmy.sdf.org 6 points 11 months ago (1 children)

I've tried several dotfile managers, but after adding my files I interact with them so infrequently I forget how to use them.

The thing which finally stuck is this method from Atlassian: https://www.atlassian.com/git/tutorials/dotfiles

Your entire home directory is a bare git repo which ignores untracked files. It's just plain git so there is no additional tool to learn or forget.

I've put my vim plugins as git submodules so they're easily and efficiently tracked and updated too.

load more comments (1 replies)
[–] lordnikon@lemmy.world 6 points 11 months ago

lazy git plus gnu stow works great for me

[–] spacemanspiffy@lemmy.world 6 points 11 months ago

Git, GNU Stow, and a custom bash script.

[–] db2@sopuli.xyz 5 points 11 months ago

ls and nano 💪

[–] wiikifox@pawb.social 4 points 11 months ago (1 children)

I use a bare git repo in .dotfiles/ that uses the home folder as a working tree, configured the repository to ignore untracked files, and then just add my dotfiles if there's a change.

To setup working dirs I aliased that to dtf

[–] suprjami@lemmy.sdf.org 3 points 11 months ago
[–] Grass@sh.itjust.works 4 points 11 months ago

I didn't know this was a thing. I just use a USB and my nextcloud and copy my home folder with distro and date appended to the name.

[–] Syudagye@pawb.social 4 points 11 months ago

I use git and nix (home-manager) for most of my dotfiles. The main advantage of this is that if manages dotfiles, but also you whole user environment, so you can install some software that you need for your rice for example. It's very powerfull, but it takes time to get it to work properly since you have to learn nix expressions !

[–] promitheas@iusearchlinux.fyi 4 points 11 months ago (1 children)

I use chezmoi for mine. I haven't had to restore after a nuke yet (hopefully not anytime) but its really simple IMO. Its basically a git wrapper, so there you have your version control. You create a dotfiles repo in your GitHub, initialise your home as a local repo and point it there using chezmoi, and then its as simple as typing "chezmoi add myfile" to start tracking the file in the repo. Then I simply do "chezmoi cd" followoed by the standard git commands to commit and push changes to remote.

Check it out, I'm happy working with it across my desktop and laptop (working on the same config files across both pcs).

load more comments (1 replies)
[–] ExLisper@linux.community 4 points 11 months ago

rsync and rm

[–] Secret300@sh.itjust.works 3 points 11 months ago

Never have, definitely need to tho

[–] dino@discuss.tchncs.de 3 points 11 months ago (5 children)

chezmoi, although I am not sure I like it. Its the first I tried and some stuff seems very complicated.

load more comments (5 replies)
[–] mcepl@lemmy.world 3 points 11 months ago (1 children)

You don’t need a dotfile manager, you need proper backups.

[–] Chobbes@lemmy.world 2 points 11 months ago* (last edited 11 months ago)

Por que no los dos?

[–] dotslashme@infosec.pub 3 points 11 months ago

Manager? I just use a good old shell script that mirrors a tree structure into my home folder.

[–] aairey@lemmy.world 3 points 11 months ago* (last edited 11 months ago)

dotdrop, because different dotfiles per OS/hist is supported (I am usingfedora, Ubuntu, Debian, macOS but you can configure it as you wish).

[–] cow@lemmy.world 3 points 11 months ago (1 children)

My home directory is a git repo with a .gitignore that contains something like


*

!.config/sway

!.config/sway/*

!.config/sway/**/*

[–] CaptainJack42@discuss.tchncs.de 3 points 11 months ago (1 children)

I thought about this, but doesn't this make problems when working with other git repos in subfolders of your home directory?

load more comments (1 replies)
[–] CaptainJack42@discuss.tchncs.de 2 points 11 months ago (1 children)

git.

In all honesty, I'd just write a bash script, potentially reading from a file listing all the dotfiles you want to back up, copy them into some directory and pushing to a git repo. Run that script on a systemd timer (or manually) and write another script deploying them into the correct locations

[–] perivesta@feddit.de 2 points 11 months ago

That's basically what dotbot does I think. Can recommend

[–] manned_meatball@lemmy.ml 2 points 11 months ago* (last edited 11 months ago)

My own intricate system of 4 git repos to manage dotfiles, bash initialization, cli tools/scripts, and system state.

The last one keeps track of installed packages and "dotfiles" out of the home directory (system config files like /etc/hosts).

[–] ultra@feddit.ro 2 points 11 months ago

I use home-manager

[–] neosheo@discuss.tchncs.de 2 points 11 months ago

I just rsync my home dir to a backup and then rsync it to a new machine

load more comments
view more: next ›