~/.dotfiles 101: A Zero to Configuration Hero Blueprint
Vložit
- čas přidán 29. 06. 2024
- This video is sponsored by coder.com!
Sign up for a free trial of Coder coder.com/demo
---
Ever wondered why everyone is so obsessed with Dotfiles?
Do you have a collection of config files but aren't sure what's the best way to maintain them?
This dotfiles video covers a from-scratch to a public maintain-able repo you own!
Ways to support this channel:
🎓 Build a Second Brain With Neovim in Under 90 Minutes: learn.omerxx.com/courses/seco...
📰 Become a better engineer in just 3 minutes a week: signup.omerxx.com
⌨️ Tech I use: kit.co/omerxx/my-battle-station
LINKS
▶ github.com/omerxx/dotfiles
⏱ Timestamps
00:00 - Intro
01:20 - Structure
03:00 - Stow and Symlinks
06:38 - Using a remote repo for remote environments with Coder
#linux #macos #neovim #vim #nvim #tmux #terminal #config #dev #devops #software #development #dotfiles - Věda a technologie
I was wondering if you had any issues setting up a local workbench using the docker template. I have no issue using a GCP-based instance but the local docker instance is throwing fits because it can't find the "host-gateway". I usually use podman so I'm running a fresh install of docket and would have expected the defaults to just work out of the box.
Great video. I've been using stow for dotfile management for years but coder is about to take it to a whole new level.
Home Manager from the Nix ecosystem is the best dotfile manager by far
Why? Rebuilding every time you change your config is a pretty bad workflow.
@@ZiRo815 Reproducibility and integration, mostly.
I agree it's a pretty bad workflow, so you... shouldn't do that. You can use regular dotfiles while you're changing stuff in your config, and port it to home-manager once you're done and happy with it. Otherwise it will be too slow.
@@Flackon I find it kinda awkward to have some config done one way and some config done another way. I currently symlink everything with home manager, but it’s a little awkward. I’m thinking about using Stow for my user config instead.
@@ZiRo815 My idea is that you only have the straight config when you're setting up a program for the first time, but when you actually commit to your dotfiles repo, you port it to home-manager (either let it link to the nix store, or use a module). That way you don't really mix methods
@@Flackon yeah, I get it. My tools are configured often.
Nix makes making changing the config more effort than I want it to be, dragging me into the world of configuration management when I want to focus on whatever I’m trying to achieve. I want the configuration of my at-hand tools to be light touch but I don’t mind the configuration of my systems being a heavier lift.
Maybe this attitude will shift as I become more fluent with nix, but managing user configs with nix feels like a PITA when I’m using it, especially when it comes to translating what I want as per original tool doc-specified changes into home manager modules docs-specified changes into the actual changes I need to make to home manager config.
What is the plugin that you use for finding URL in terminal at 7:35? That looks very cool
Fzf
XD i was about to say home-manager but you mentioned it already.
what is the 'ls" program you use?
probably `eza`
Like first, digest later. And, Thanks.
If I understood correctly, coder is similar service to gitpod, though to me gitpod seems bit easier to setup. Though I havent tried coder yet.
One problem with symlinked directories is when non config files are put into the directory. Like cache files or log files by various programs. These files end up polluting the git repo, and we don’t know ahead of time which such files we’d need to gitignore. Thats why i use the -no-folding flag when i stow
A program putting logs into the config directory to me (!) is either misconfigured or not worth using since it violates sane programming on the most basic level. Same for cache files.
Say that to vscode settings on a mac
@@vikingthedude That's what I'm saying. VSCode is not worth using (to me).
@@vikingthedude you only need to commit the User dir for vscode. The extra files problem is easily solved with gitignore (you are checking what gets staged into git before committing, right?)
So I recently dove into nixos. My approach was to use hard links to bring a known set of dot files into my git repo within /etc/nixos, so they are versioned in one place. Stow only manages symlinks and git doesn't natively resolve symlinks.
Interesting approach.
Have you considered using home manager as a nixos module to manage your home directory or do you feel hard links are good enough for you ?
I will move to home manager eventually. My use case is to version control my whole setup in a single repo. I wonder if home manager can support this...
@@rujnyes it can. You might explore using flakes with home manager, which allows you to create and build everything, even the system configuration.nix, using nix modules to generate all your configs from a single $HOME/ directory tree. Vimjoyer has a great video on how to set it up.
Also, in the nix way, the configuration is not written in a discreet dotfile anyway but in a nix module which then generates and places the appropriate dotfile. In other words, linking of configs is a non-issue.
@@rujn yes it can. The question is whether you want to rebuild nix every time you change your config.
Beautiful, yes I will rebuild every time. Maybe this is overkill but I switch machines often and want the same setup. I am always tweaking and tinkering 👍
Love your video! I want to know your ideas about coder, devpod, nix-based method for managing the dotfile and dev env. Thank you!
Thanks for making this. I can't explain why, but for some reason I have a ton of procrastination around dotfiles, the concept backing them up, managing them, I feel like it's a brick wall for me to move forward for some crazy reason lol.
@@TwilightTrekker1 going over that wall is worth it. Once you have it set up, it takes very little maintenance. I can go weeks between commits to my dotfiles. Also, with stow you can just gradually build up as you need it. Don’t need to rearrange your entire config dir in one go.
or you can just use rsync and be done with it
:D
Devaju?
Does zsh on macos automatically respect XDG_CONFIG_HOME?
I tried moving zshrc to ~/.config/zshrc/.zshrc but it looks like the configuration file is not being loaded anymore
You need to add env variable
export ZDOTDIR="$XDG_CONFIG_HOME/zshrc"
to /etc/zshenv (which affects all users) or ~/.zshenv (which affects only your user) and source it ofc.
@@gorr_av Additional note for anybody having trouble setting zsh env variables on macos:
Although they should be set in /etc/zshenv Apple declares HISTSIZE, HISTFILE, and maybe a few others in /etc/zshrc
This is important to know because zsh files are sourced in order of root, user, root, user etc instead of root files followed by user files.
So if you set HISTSIZE in ~/.zshenv its value will be over written by the /etc/zshrc file which is sourced after ~/.zshenv
TLDR unless you know what you're doing just set env variables ~/.zshrc to avoid unnecessary issues.
PLS MORE NIX VIDEOS!!
Seven
chezmoi, chezmoi, chezmoi
absolutely. it has a great, powerful yet simple templating system.
CHEZMOI is king!
Using symlinks is a mistake
why?
why?
why?
Why?
Why?
I personally don't like stow. I prefer doing a bare git repo in ~/.dotfiles