this post was submitted on 03 Jan 2024
0 points (NaN% liked)
Linux
48220 readers
642 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
- Posts must be relevant to operating systems running the Linux kernel. GNU/Linux or otherwise.
- No misinformation
- No NSFW content
- No hate speech, bigotry, etc
Related Communities
Community icon by Alpár-Etele Méder, licensed under CC BY 3.0
founded 5 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
You'll want to look into a category of programs called dotfiles managers. There's a bunch of them. Most of them are based on some kind of version control system, usually git.
I personally use yadm
This sounds really similar to how I do things but I use Ansible. What are the advantages to something like yadm, that is specifically designed for dot file management, and a generic config management utility like Ansible?
I've only started using yadm recently so I may not be able to elaborate in detail, but for me the main draw for using yadm (as opposed to Ansible, which I use at work) is the simplicity. It's basically just a bash script that uses git, so there's no dependencies besides git and tools installed on most Unix systems. Ansible felt like overkill for what I needed, ie just something to manage and sync my dotfiles.
Also, maybe it's personal bias, but I really hate installing/using Python-based programs - they often tend to go wild with their dependencies and eventually break. I recall trying to install Ansible on a Raspberry Pi at some point (via pip) and it failed because one of the dependencies couldn't be compiled for whatever reason. I gave up after trying to fix it for a while, and dropped the idea. I've had similar experiences with other large Python projects, there's always some drama. Why is why I prefer compiled binaries or simple shell scripts like yadm.
I've no issues using Ansible at work though. We use it on RHEL so it's quite stable and doesn't have the dependency issues you'd get on a bleeding-edge, ever-changing, end-user system. Plus it really shines at the Infrastructure as Code stuff so we use it to automate everything from networking gear to VMs. But I feel it's overkill for something as simple as syncing a bunch of text files.
I recently started uses dotbot for managing dot files across my systems. It sounds very similar, in terms of the simplicity of the implementation, to yadm. You define a config file in yaml or json and run the "install" script which calls the dotbot utility, passing in your config file. With a simple change to the install script, I've been able to create multiple config files, one per environment (work, home, linux, mac, etc.) and I've been thinking about how I could automatically sync changes to git whenever I edit a config file. Leaning towards setting up an autocmd in neovim to automatically commit and push changes on save when I have one of the config files open. Just not yet sure how to do this in a way that would only run the sync for the configs and not every json or yaml file on my system. I've only ever set up autocmds for specific file extensions but the syntax leads me to believe it's flexible enough that any arbitrarily specific file name or path could work the same.