# Advice on Multi-System flake configuration

**URL:** https://discourse.nixos.org/t/advice-on-multi-system-flake-configuration/74518
**Category:** Help
**Created:** [January 20, 2026, 6:12pm UTC](https://discourse.nixos.org/t/advice-on-multi-system-flake-configuration/74518 "2026-01-20T18:12:37Z")
**Posts on this page:** 1
**Showing post:** 5

<div class="post-metadata">

### Author: ![bow](https://discourse.nixos.org/user_avatar/discourse.nixos.org/bow/32/27312_2.png) [@bow](https://discourse.nixos.org/u/bow)
#### Post date: [January 21, 2026, 3:51pm UTC](https://discourse.nixos.org/t/advice-on-multi-system-flake-configuration/74518/5 "2026-01-21T15:51:08Z")

</div>

> How can I configure multiple systems with the same structure but without repeating code or definitions like the hostname?

You can make your own `lib` function that returns a `nixosSystem` exactly the way you want it. That’s what I did [in my own modules system](https://github.com/bow/nixsys/blob/6d4656ea764f44d027ee041144a22aa5b7d9220e/lib/default.nix#L80). You can, for example, make it so that the `hostname` is just a function argument specified once then the return value is an attribute set that maps that given hostname to the create `nixosSystem` value. Anything really.

> How can I set up my `home-manager` so that it isn’t completely separate from my system configuration such that it only configures software it needs to?

What worked for me was to make an additional ‘profile’ abstraction (naming things are hard 😕). But it’s basically just a collection of pre-set module options, which by itself is also a module.

Once you’ve captured all your home-manager config as a module, then it’s just a matter of embedding this in a NixOS config (so you’ve to run home-manager as a NixOS module). Another reason I do it this way, is so that I can still use home-manager standalone on external systems (e.g. a remote server).

That said, the question of whether packages should be managed by home-manager or NixOS does not always have a clean answer. It’s up to you to decide how strong this separation should be.

---

_[View the full topic](https://discourse.nixos.org/t/advice-on-multi-system-flake-configuration/74518)._
