Check out a free preview of the full Developer Productivity course
The "YADM & Setup Tools Review" Lesson is part of the full, Developer Productivity course featured in this preview video. Here's what you'd learn in this lesson:
ThePrimeagen discusses how Yet Another Dotfile Manager manages dotfiles, benefits and drawbacks, and provides a personal review of some of the trade-offs of each management system. A student's question regarding bare repositories and a brief summary of the material covered so far is also provided in this segment.
Transcript from the "YADM & Setup Tools Review" Lesson
[00:00:00]
>> Lets talk about a different dotfile manager, just for a moment. Cuz I do think it's important to know that there's other options available. I don't wanna just say, hey, here's the best thing, and tell you nothing. It's kind of rude. And in reality, it's just use what you like.
[00:00:14]
Now if you go to the homepage of Yet Another Dotfile Manager they did write this for you and I feel obligated to read it. [COUGH] When you live in a command line configurations are deeply personal thing. They are often crafted over years of experience, battles lost, and lessons learned, advice followed and ingenuity rewarded.
[00:00:34]
When you are away from your own configurations, you are in an orphaned refugee and an unfamiliar and hostile surroundings. Little intense I would agree. You feel clumsy and out of sorts, you are filled with a sense of longing to be back in a place you know. A place you've built.
[00:00:48]
A place where all the short-cuts have been worn bare by your own travels. A place you proudly call $Home. Yeah, so that's a little intense, right? It's a little intense for so right away I'm like, I don't know if I can use yet another dotfile manager. It almost feels like Lord of the Rings without all the Lord talent skill and all the things that kind of gone into Lord of the Rings.
[00:01:06]
So I was just like, okay, this is kind of silly, but whatever, we'll let it go. And so yeah, Adams actually, it's a clever program. I'm gonna use clever in a proper way. It does some neat things. It actually wraps Git, and it creates your home directory into a Git repo.
[00:01:25]
But obviously if you did git status in your home directory what would happen? All of your personal projects, all of your work projects, all the enormous amounts of node module files will all be in there, right? You won't even be able to tell what's going on if you did get status, it might even freeze your computer.
[00:01:39]
I actually am very curious to see what happens if I tried to get add my entire computer. It'd be very exciting to see what would happen. But nonetheless what got him does is it wraps get in and allows for you to clone into your home directory. And then on top of it It allows when you do like yiadom status, it only shows you the things that have changed.
[00:01:59]
It doesn't show you your entire system, right? Because that'd be just crazy. And so then if you want to add something, it's just like Git yiadom add this file, I want to add the lsp.vim. Awesome. Great everything's working right? So it behaves a lot like Git, but it allows things to work.
[00:02:16]
It also has a vaulting technique just like Ansible, so you can store your SSH keys. So fairly convenient, but it doesn't have quite the same level as Ansible does for power usage. It's not as powerful but it does have things available. So you're probably asking yourself, well what do I do?
[00:02:32]
Do I use the YADM or do I use Stow? I haven't even mentioned dotbot, but dotbots, another one of these really popular ones. You can go look it up. I don't even use it. But what should you use? Well, I'm gonna tell you what I use and why I use it, cuz I'm not a super opinionated person in most things.
[00:02:49]
I just find that I like certain trade offs more than other people like certain trade offs, right? I'm a very singular screen, individual. Some people my goodness, they just love splits, right? I can't do that it stresses me out. I just want one screen, right? And so we all have our own likes and dislikes.
[00:03:04]
So for me, as far as I see, YADM doesn't have a spot to me, or first spot for me. It's simpler than Ansible, meaning that Ansible has a really rich ecosystem. Lots of plugins, really easy way to do installation, working with SSH keys doing faulting. It's all kind of built in.
[00:03:19]
It has a really great system for it. And yet I'm just isn't there, but it's way more complex than Stow meaning that it just still is so simple. It has this really beautiful separation of concerns, right? Stow just manages your siblings and your siblings happened to be your dotfiles.
[00:03:37]
Ansible manages your computer setup beautiful symmetry right there right our beautiful asymmetric relationship right there. It's just they do they work with each other so well up Ivan.
>> What about bear repos?
>> So well YADM does use technically a bear repo I did use a bear repo for a little YADM It's just as a helper right.
[00:03:54]
If you use bear repos, you should just use the YADM honestly, because it creates all of that within your home directory. But then it just has all the nice things built around it so you don't have to have like that Git ignore that you're uncut, ignoring certain things like it just does it for you.
[00:04:07]
So it's nicer just use YADM. I guess I should have mentioned that you are right, though. Bear repos are like I'd say the predecessor to YADM or DAPA. Really those two are kind of like the, that. So what are the pros and cons? One thing that's neat about YADM, obviously it has the ansible vault, like nature.
[00:04:26]
It does the bear repo makes it really, really nice. But I'd say a major con and such a con that it makes me not wanna use the system. And it's the same reason why I don't use a bear repo also. Is that when you're all by the way YADM also as OS switches.
[00:04:40]
So you can actually do some OS independent operations, which is pretty cool. So it actually can be a multi OS kind of system. But one thing that I really, I just can't do is that let's say you've added a new script, right? You add a new program, you add to download some work thing and it comes with a configuration file.
[00:04:57]
So you need to get it up there and you need to get it in. Well, unfortunately, you forgot to add it to YADM. So if you go YADM status ,is it gonna show you that file? No, you don't know what you are and are not added to YADM, right?
[00:05:09]
You're gonna have to go review your files, make sure you have those things running. And for me that's really painful. And the reason why I love Stow is that if I go to my .files, which I'm already here in my .files, there we go. That if I change something like git status, I have nothing here.
[00:05:27]
So if I change anything, if I just add a file file, right, and I save it, I can literally go git status and I go, wow, yeah, I still haven't committed this thing yet. And so Stow allows me to have this really nice management but I know exactly what the state of my stuff is in.
[00:05:42]
Now obviously the con to stow is that before I put any RC into my system, I first have to create its file structure and folder-like nature inside of my Stow directory. And then properly put it where it should be mapped into my home directory. And then on top of that, I need to create the file and make sure it's saved there.
[00:06:01]
And then I have that nice Git kind of, I've made this change, I need to commit it. And for me, I have to do a piece of work no matter what for either approach. It's just one of them is really easy to know when I've screwed up the other one is much harder, I feel like and I don't know I like Stow better.
[00:06:17]
Stow just feels more natural. Whereas the YADM just takes such advantage of your home system. I could see myself constantly forgetting to add files. So, personal choice, go check it out, make your own determination. I think that's just the best way to live anyways. So this really kind of marks the end of section one.
[00:06:36]
This is how you get your computer kind of up and running and being something right away. Hopefully if you if everyone here takes the time it might take you a day now, but it's gonna save you days in the future when you have all these things set up.
[00:06:51]
Because that's the reality is like even we were talking about this last night. It's like that thousand cut problem where you get a new computer, you think you have everything up and running day two day ten comes by and you're like, I forgot that one thing. Then if your computer's broken, like it's gone forever, but if you still have your plane, that weird game of getting one file to the other computer, it's just like, it's always such a mess.
[00:07:14]
It's never smooth. And so I've just finally decided after having to do it way too many times. I'm just going to simply have a system that I can recreate at any moment. Now, inevitably libraries are going to change, things are going to change, I am going to have to do some level of maintenance to my script.
[00:07:28]
So my goal is to try to keep it pretty simple and only have the things that are really important. And then try to actually have maybe separated scripts one for just my job right. Here are all the teams I work on, here's all their installation processes. So it's always a little bit easier to know when things have gotten out of sync, a little easier to just kind of maintain those.
[00:07:48]
Cuz then if I have a new computer, I don't have to have everything ready. I may only need my personal stuff, plus the one team I'm currently working on. It just makes life, I'd say, a little bit easier. We did talk about Ansible. So hopefully you feel that hopefully you're really excited about Stow.
[00:08:01]
I think Stow is really great. And really, I'd say the hardest part about this section is it's just adopting a new mindset, right? The mindset is that you have to be willing to change a few things of how you do it now to gain the benefit for you in the future.
[00:08:15]
Because let's just face it, we all don't care about me in the future. We're all like, I'll just he'll just get the computer running, right? And so it's like, really, you gotta wanna help yourself later on. Because it is going to just save you just a enormous amount of time.
[00:08:30]
I feel like today I could honestly get a brand new computer up and running in about 30 minutes, right because installation just takes so long. Getting i three installed I have to shut things down and relaunch and backup with i three running all that so it should be but it should be fairly darn quick.
[00:08:46]
You should also probably follow my approach if you're gonna do this, create a Docker image right? Create a docker image with nothing on it so you can just test hey. I want to make sure I have this installed or if you like fish you use fish by the way I used to sit next to the ridiculous fish the guy who wrote fish is pretty nice guy.
[00:09:00]
But you just test it. Make sure all of your installation works cuz when it comes to actual game time like you're now it's time to put it on your computer. You don't want things failing, then. Make it fail now use a Docker image really simple as doing the exact same thing.
[00:09:15]
Plus if you don't know how to use Docker, great time to learn a little bit about Docker, right. It will help you a bunch throughout your career.
Learn Straight from the Experts Who Shape the Modern Web
- In-depth Courses
- Industry Leading Experts
- Learning Paths
- Live Interactive Workshops