# Strategy to use same config at work and home

**URL:** https://discourse.nixos.org/t/strategy-to-use-same-config-at-work-and-home/34317
**Category:** Help
**Created:** [October 18, 2023, 2:13pm UTC](https://discourse.nixos.org/t/strategy-to-use-same-config-at-work-and-home/34317 "2023-10-18T14:13:20Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![Jerith](https://discourse.nixos.org/user_avatar/discourse.nixos.org/jerith/32/246_2.png) [@Jerith](https://discourse.nixos.org/u/Jerith)
#### Post date: [October 20, 2023, 12:09pm UTC](https://discourse.nixos.org/t/strategy-to-use-same-config-at-work-and-home/34317/2 "2023-10-20T12:09:19Z")

</div>

I haven’t taken the plunge into home manager yet, but I’ve done this with my `/etc/nixos/configuration.nix`.

My approach is to keep my configuration in a git repo, with clones on my home and work machines.

I have an import like `adminInfo = import ./admin-info.nix {};` in `configuration.nix`. And I have two files in the repo:

`home-admin-info.nix`:

```nix
{}:

{
  user = "matt";
  hostName = "alpha";
  domain = "mchenryfamily.org";
}

```

`work-admin-info.nix`:

```nix
{}:

{
  user = "mmchenry";
  hostName = "mmchenry-nixos";
  domain = "work.com";
}

```

The only thing that’s not version controlled in git is the `admin-info.nix` symlink, which points to the appropriate `*-admin-info.nix` on each machine.

Then elsewhere in `configuration.nix`, I can refer to these variables, e.g. `networking.hostName = adminInfo.hostName`.

I also have `hardware-configuration.nix` symlinked to `home-hardware-info.nix` or `work-hardware-info.nix`, since the machines need different kernel modules etc.

---

_[View the full topic](https://discourse.nixos.org/t/strategy-to-use-same-config-at-work-and-home/34317)._
