Nix Home Manager Tutorial

Поділитися
Вставка
  • Опубліковано 8 лис 2024

КОМЕНТАРІ • 20

  • @DevInsideYou
    @DevInsideYou  Рік тому +4

    This is how you can see a diff between the last 2 generations:
    home-manager generations | head -n 2 | tac | cut -d " " -f 7 | xargs nix store diff-closures
    You can also use a separate tool called nvd to do this:
    home-manager generations | head -n 2 | tac | cut -d " " -f 7 | xargs nvd diff

  • @MikeDent
    @MikeDent Рік тому +6

    A lot of great information but delivered in a slightly confusing way.

    • @DevInsideYou
      @DevInsideYou  Рік тому +5

      I'm not an expert, but if you have specific questions I'll try to answer...

    • @kodekata
      @kodekata Рік тому +5

      There is only so much simplification that can be done here lol

  • @StaffyDoo
    @StaffyDoo Рік тому +3

    I’ve have one word for you my friend: Chezmoi. I used to use GNU Stow a lot some few years ago, it is a good tool but IMO managing dot files with it still requires a good amount of effort. Up until two, maybe three months ago, I was managing my dot files using a similar approach, but with a home brew solution that allowed me to keep all the stuff versioned on a repo, while taking care of special cases like managing similar configuration files for different hosts (my battle station, my laptop and my home lab / NAS headless MiniPC). All was rainbows and unicorns (more or less) until I learned about `chezmoi`. BOY, OH BOY. At first I was a bit weary about using something else to manage my dot files, specially somebody’s else tool, since I was reasonably comfortable using my own solution, but still I pushed myself to give Chezmoi a try based on the rave reviews I saw everywhere. Just a bunch of few days later I KNEW I couldn’t make it anymore without Chezmoi. You know some tool is good, or at least it serves well it’s purpose when you find yourself using it as an extension of yourself, without even thinking about it. That’s what happened to me with Chezmoi. It makes a breeze to manage not only your dot files, but every kind of file and directory you throw at it. Among its great features is the automatic handling of the Git repository it uses to track the changes. But what sold it to me, is that you can also encrypt your files and directories using a GPG key (friendly reminder, don’t forget to give it s password), which is a game changer IMO. I can now safely store sensitive data like ~/.ssh on my “private” remote repository, immensely easing sharing such information between hosts - while keeping it versioned! This is why I ultimately postponed using Home Manager to manage my $HOME in addition to the CLI tools I manage with it. Anyway, really nice video (sub’bed!), I enjoyed it thoroughly, I’ll make sure to watch the rest of the stuff you got on Nix 🎉

    • @DevInsideYou
      @DevInsideYou  Рік тому +2

      I heard about chezmoi, but never had the time to check it out. I will at some point for sure. It can't install programs though like home-manager would, right? It's "only" for dotfiles, isn't it?

  • @MultiMediaUploads
    @MultiMediaUploads Рік тому +1

    Are you considering installing the NixOS WSL2 distro?

    • @DevInsideYou
      @DevInsideYou  Рік тому +3

      I didn't know it existed. Now that I know, thanks to you, I will definitely check it out!

    • @MultiMediaUploads
      @MultiMediaUploads Рік тому +1

      @@DevInsideYou Would love to see an updated video on how you manage your dev env, if you do end up using the distro 😁

  • @the_nurk
    @the_nurk Рік тому

    my hero

  • @BadalSingh003
    @BadalSingh003 Рік тому

    Thanks for the tutorial, really helped me since i didn't wanted to do anything fancy. Just needed a way to keep my packages in sync. Just a question, if the packages defined in home.nix gets an update, how do i upgrade them on my system ? Just run the home-manager switch.. command ? Or there's a different command for that

    • @DevInsideYou
      @DevInsideYou  Рік тому +2

      I'm glad you liked it. There are 2 parts to the answer 1) `nix flake update` downloads information about the new versions of packages by updating the lock file, 2) home-manager switch applies any changes made to your flake including the changes made to the lock file by the update.
      Step 1) is not always necessary. For instance if you add a new package it's enough to run 2). You might be adding an outdated version of that package though if it's been a long time since you ran 1) which is ok because you can run 1) in any oder.
      Hope it helps.

    • @BadalSingh003
      @BadalSingh003 Рік тому

      @@DevInsideYou Thanks understood. I have my home.nix and flake.nix in .config/home-manager so `home-manager switch` works directly for me as its the default path where it looks at but when i run `nix flake update` in my home dir, it for some reason searches in the home dir only ( not in .config/home-manager) and says flake.nix not found. I think its necessary to pass the flake.nix path along with it, can you help me with the correct syntax for this command

    • @DevInsideYou
      @DevInsideYou  Рік тому +1

      Yep, here is how I do it `nix flake update ~/.dotfiles/nix/home-manager`

  • @kodekata
    @kodekata Рік тому +5

    I'm sorry but I'm dying every time I read your YT name... I can't help but think it is a dirty joke :D

    • @DevInsideYou
      @DevInsideYou  Рік тому +2

      Yeah that joke got old the second I came up with this name :) Anyway... It's about improving the developer inside you...

    • @sighup124
      @sighup124 10 місяців тому

      Things get better if you add his github name to it 😂

  • @DerekMurawsky
    @DerekMurawsky Рік тому

    This is such awesome content, but you talk *very* quickly. It's hard to follow some times when you get quiet.
    Please keep it up, though!

  • @VigilanceTech
    @VigilanceTech 2 місяці тому

    man, your fonts on your web browser are SUPER tiny. VERY hard to read.

    • @DevInsideYou
      @DevInsideYou  2 місяці тому

      I recorded it on a 15 inch 1080p monitor and it's the default font size in chrome. I guess I could increase it when I record. Thx for letting me know.