dotfiles
dotfiles copied to clipboard
Why move away from home-manager?
I've been following your work since you posted those videos about nix flakes in your YouTube channel. It's really a great work, I even changed my nix dotfiles configuration to use nix flakes based in yours.
Now I see you are dropping home-manager entirely from your config, moving all to modules that maybe will require root password to be applied.
In my case this is something that I do not have in my Linux machine at work, which luckily I convinced IT personnel to install nix support in it, leaving me home-manager to configure my user directory without root privileges, which is great.
Do you have any strong reason to have done it?
Hi Rafael, There is nothing wrong with home manager and I still recommend people use it. Your situation is actually a really good use case for it.
The reason I removed it from my config is I am trying to move to a setup where I have a small base system and then can layer flakes which have workspaces in them over the top.
I should probably break parts of my config out into another repo so its easier for other people to use.
Regards, Wil
Hey, sorry, do you mind elaborating on this a bit? I watched your videos (which were great btw) to get an introduction to flakes... so I'm trying to move I guess, to a more modular system, where I can reuse configurations on different systems...
I've been using home-manager, but I'm just wondering about these workspaces....
Thanks!
@rembo10 Hey sorry about the delayed reply. The reason I decided to move to a workspace approach (term i made up I am working on a simple script to do it at the moment).
I found the home-manager and nixos system config approach didn't really work for my approach to using systems.
- I have a bunch of machines that I am the only user on.
- I have more machine specific things than I do user specific.
- I found I had to make hacks to get machine specific settings into my home manager settings and the only reason I was using it was it made setting user specific settings easier.
- Most of my computer use is actually based on different workflows. In a lot of cases I want to use the same programs but have separate configuration files and credentials etc.
- I also find that having a docker image with all of my tools in it would be useful so I can run them when I am on other machines like work computers.
So I decided to make the following changes to my setup:
- Move all of my settings into my system configuration so they are machine specific and not user specific. I made a small change to my system modules to make it easy to put user settings in.
- Create my own workspace scripts so i can create a flake that has a set of tools in it and make it easy to jump into a shell with said tools and isolate the home directory of it so I can have separate settings if I want.
- Once I have broken out all the software into workspace try to keep the system config as small as possible.
I am also going to create some templates that people can use too that still have various amounts of home manager integrated in them too since I don't think my own workflow will be all that useful to the majority of people.
@wiltaylor thanks for elaborating on that! I also just came from watching your youtube series (which was super helpful, thanks a lot for that!), and your use case matches mine pretty closely: different machines and VMs, both local and cloud; and different contexts on each machine (segmented by programming language; personal vs work stuff; different usernames and credentials for different github accounts, etc.) but I'm the only user on all of them.
So it seems like it would be easier to understand and manage a nixos config where I don't bring in an external dependency like home-manager that I don't understand in detail and probably won't use much of, and have everything be more explicit and visible to me.
I'm even considering at first just copy-pasting /etc/nixos/configuration.nix and /home/user/.config/nixpkgs/home.nix from your videos right into the flake.nix file and then delete the originals (also the later versions moved into .dotfiles) instead of importing them so I have a single file with everything inlined. Then as I learn more about nix and nixos I can start abstracting and extracting out and importing things that make sense.
Sort of like the elmlang people recommend you wait until a file gets uncomfortably large before trying to create directory structures and whatnot that might make things harder to move around and edit later.
Anyway NNTR and thanks for the great lessons and inspiration! Cheers.
@wiltaylor thanks so much for the thoughtful reply. I think I have a pretty similar setup so I'll be keeping an eye on the repo
I hope you keep making great videos!
I am also going to create some templates that people can use too that still have various amounts of home manager integrated in them too since I don't think my own workflow will be all that useful to the majority of people.
@wiltaylor hi thanks for your videos, very helpful.
It would be great that if you can elaborate your current setup with a blog post or video.
Cheers.
That would be nice. I'm planning out a migration to NixOS and your videos and configs are very useful, but I am currently reluctant because I'm not comfortable enough changing (and breaking) things.
New video series would be amazing!!! Please Wil you are our only hope!
I know I'm sorry will try to get to it at some point soon. Just been snowed under with all kinds of stuff happening in my life for a bit.