~/.dotfiles 101: A Zero to Configuration Hero Blueprint

Sdílet
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

Komentáře • 66

  • @clayratliff7727
    @clayratliff7727 Před dnem

    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.

  • @rebelg
    @rebelg Před 2 dny +7

    Home Manager from the Nix ecosystem is the best dotfile manager by far

    • @ZiRo815
      @ZiRo815 Před dnem

      Why? Rebuilding every time you change your config is a pretty bad workflow.

    • @Flackon
      @Flackon Před dnem

      @@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.

    • @ZiRo815
      @ZiRo815 Před dnem

      @@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.

    • @Flackon
      @Flackon Před 21 hodinou

      @@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

    • @ZiRo815
      @ZiRo815 Před 12 hodinami

      @@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.

  • @hanzomaster
    @hanzomaster Před 2 dny

    What is the plugin that you use for finding URL in terminal at 7:35? That looks very cool

  • @niksingh710
    @niksingh710 Před 14 hodinami

    XD i was about to say home-manager but you mentioned it already.

  • @AestheticAMV
    @AestheticAMV Před 2 dny +1

    what is the 'ls" program you use?

  • @jizhang2407
    @jizhang2407 Před dnem +1

    Like first, digest later. And, Thanks.

  • @PetrSzturc
    @PetrSzturc Před 2 dny

    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.

  • @vikingthedude
    @vikingthedude Před 2 dny

    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

    • @guidon.5413
      @guidon.5413 Před 2 dny +8

      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.

    • @vikingthedude
      @vikingthedude Před dnem

      Say that to vscode settings on a mac

    • @guidon.5413
      @guidon.5413 Před dnem

      @@vikingthedude That's what I'm saying. VSCode is not worth using (to me).

    • @Flackon
      @Flackon Před 12 hodinami

      @@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?)

  • @rujn
    @rujn Před 2 dny

    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.

    • @gungun974
      @gungun974 Před 2 dny

      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 ?

    • @rujn
      @rujn Před dnem

      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...

    • @biscotty6669
      @biscotty6669 Před 12 hodinami

      ​@@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.

    • @ZiRo815
      @ZiRo815 Před 12 hodinami

      @@rujn yes it can. The question is whether you want to rebuild nix every time you change your config.

    • @rujn
      @rujn Před 6 hodinami

      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 👍

  • @user-xd5gd4pc9h
    @user-xd5gd4pc9h Před dnem

    Love your video! I want to know your ideas about coder, devpod, nix-based method for managing the dotfile and dev env. Thank you!

  • @TwilightTrekker1
    @TwilightTrekker1 Před dnem

    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.

    • @Flackon
      @Flackon Před 12 hodinami

      @@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.

  • @ThalesTheDuck
    @ThalesTheDuck Před 3 hodinami

    or you can just use rsync and be done with it

  • @briainodriscoll
    @briainodriscoll Před 8 minutami

    :D

  • @alexferreira1534
    @alexferreira1534 Před 2 dny +2

    Devaju?

  • @reuben2311
    @reuben2311 Před 2 dny

    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

    • @gorr_av
      @gorr_av Před dnem +1

      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.

    • @j4yd34d5
      @j4yd34d5 Před 20 hodinami

      ​@@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.

  • @ViCantWin
    @ViCantWin Před 2 dny +6

    PLS MORE NIX VIDEOS!!

  • @RuanSilva-kk1gq
    @RuanSilva-kk1gq Před 2 dny

    Seven

  • @naranyala_dev
    @naranyala_dev Před 2 dny

    chezmoi, chezmoi, chezmoi

    • @atarShirim
      @atarShirim Před 58 minutami

      absolutely. it has a great, powerful yet simple templating system.
      CHEZMOI is king!

  • @Danielo515
    @Danielo515 Před 2 dny +2

    Using symlinks is a mistake

  • @sujezz
    @sujezz Před dnem +1

    I personally don't like stow. I prefer doing a bare git repo in ~/.dotfiles