I finally managed to get home manager working on both my linux machines (non-nixos) and my macbook pro. I thought it might be worth sharing a simple template to document the approach, because I...
I finally managed to get home manager working on both my linux machines (non-nixos) and my macbook pro. I thought it might be worth sharing a simple template to document the approach, because I could not find an example configuration to help me. I offer this template for anybody interested in getting started with home-manager.
It is bloody amazing to be able to maintain a consistent shell environment across all my devices.
There is actually a way to simplify the flake.nix even more, but it would require using the --impure flag to access builtins.currentSystem. I already am impure because I needmkOutOfStoreSymlink in order to configure my ~/.ssh directory, but used the more verbose approach for this template.
Yes, that way you can configure your aliases, prompt, programs, etc. one time and easily keep it in sync across machines. It makes it actually worth it to invest time in configuring a very custom...
Yes, that way you can configure your aliases, prompt, programs, etc. one time and easily keep it in sync across machines. It makes it actually worth it to invest time in configuring a very custom terminal environment because it's so easy to set up on new machines once you have it working.
One feature I really like is that you can declaratively configure any file you need in your home directory. Makes it easy to keep track of your dotfiles, even for things you don't install with nix.
If I want to get my terminal up on a new machine (like a container or VM) I just clone or symlink my home-manager repo to ~/.config/home-manager , install nix, and run the command in the README.
I don't think it's worth using NixOS as a beginner with nix. It is too aggravating when you want to install something that is unsupported and are unable to do so without packaging it yourself. But home manager with a simple flake config just to configure your dotfiles is uniquely useful.
awesome, thank you! do you think you could share yours? I'm curious as to what it looks like... all I can picture is basically config files wrapped in another layer of config
awesome, thank you! do you think you could share yours? I'm curious as to what it looks like... all I can picture is basically config files wrapped in another layer of config
I can't share my whole repo since it's got some secrets. Here's my home.nix though, which is the core where I configure everything. I only take things out of home.nix and move them into their own...
I can't share my whole repo since it's got some secrets. Here's my home.nix though, which is the core where I configure everything. I only take things out of home.nix and move them into their own files when they start getting too unwieldy inside home.nix. It's messy, though not particularly complicated.
Yep. The options can be referenced in man home-manager.nix or here: https://mipmip.github.io/home-manager-option-search/ Pretty much every supported program has an attribute for freeform text...
You may also be interested in this project I just found: https://github.com/ublue-os/fleek Additionally, a nix template from more experienced nixers than me:...
I finally managed to get home manager working on both my linux machines (non-nixos) and my macbook pro. I thought it might be worth sharing a simple template to document the approach, because I could not find an example configuration to help me. I offer this template for anybody interested in getting started with home-manager.
It is bloody amazing to be able to maintain a consistent shell environment across all my devices.
There is actually a way to simplify the flake.nix even more, but it would require using the
--impure
flag to accessbuiltins.currentSystem
. I already am impure because I needmkOutOfStoreSymlink
in order to configure my~/.ssh
directory, but used the more verbose approach for this template.would you say it's worth it to just use home manager?
Yes, that way you can configure your aliases, prompt, programs, etc. one time and easily keep it in sync across machines. It makes it actually worth it to invest time in configuring a very custom terminal environment because it's so easy to set up on new machines once you have it working.
One feature I really like is that you can declaratively configure any file you need in your home directory. Makes it easy to keep track of your dotfiles, even for things you don't install with nix.
If I want to get my terminal up on a new machine (like a container or VM) I just clone or symlink my home-manager repo to
~/.config/home-manager
, install nix, and run the command in the README.I don't think it's worth using NixOS as a beginner with nix. It is too aggravating when you want to install something that is unsupported and are unable to do so without packaging it yourself. But home manager with a simple flake config just to configure your dotfiles is uniquely useful.
awesome, thank you! do you think you could share yours? I'm curious as to what it looks like... all I can picture is basically config files wrapped in another layer of config
I can't share my whole repo since it's got some secrets. Here's my home.nix though, which is the core where I configure everything. I only take things out of home.nix and move them into their own files when they start getting too unwieldy inside home.nix. It's messy, though not particularly complicated.
https://gist.github.com/crasm/59938f3364d2df6319604a5f3fb927fb
thank you! this gives me an idea. so it looks like it's partly inserted for strings and partly a dsl?
Yep. The options can be referenced in
man home-manager.nix
or here: https://mipmip.github.io/home-manager-option-search/Pretty much every supported program has an attribute for freeform text configuration since not everything can be a nix option.
You may also be interested in this project I just found: https://github.com/ublue-os/fleek
Additionally, a nix template from more experienced nixers than me: https://github.com/Misterio77/nix-starter-configs/tree/main/minimal