Reusing configuration on multiple users

Hello there,

I was wondering if there’s a recipe on home to reuse configuration on multiple users, in my case I’m configuring the user with home-manager.

The ive a configuration that is working well for me, but I’m about to setup a machine that has 2 users (eg my personal and my work users). They share everything from the same base - with maybe the work one getting some extras.

Copying the file and changing the usernames sound not very efficient, so I’m wondering if there’s a nicer way of doing it :thinking::crossed_fingers:

Could put the parts common to both users in a common.nix, create files user1.nix and user2.nix, and make each contain

{
  imports = [ ./common.nix ] ;
  # Custom parts for that user.
}
1 Like