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
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 🎉
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?
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
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.
@@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
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
A lot of great information but delivered in a slightly confusing way.
I'm not an expert, but if you have specific questions I'll try to answer...
There is only so much simplification that can be done here lol
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 🎉
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?
Are you considering installing the NixOS WSL2 distro?
I didn't know it existed. Now that I know, thanks to you, I will definitely check it out!
@@DevInsideYou Would love to see an updated video on how you manage your dev env, if you do end up using the distro 😁
my hero
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
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.
@@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
Yep, here is how I do it `nix flake update ~/.dotfiles/nix/home-manager`
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
Yeah that joke got old the second I came up with this name :) Anyway... It's about improving the developer inside you...
Things get better if you add his github name to it 😂
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!
man, your fonts on your web browser are SUPER tiny. VERY hard to read.
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.