# Writing custom modules for nixos configuration

**URL:** https://discourse.nixos.org/t/writing-custom-modules-for-nixos-configuration/79652
**Category:** Help
**Created:** [August 18, 2026, 8:55am UTC](https://discourse.nixos.org/t/writing-custom-modules-for-nixos-configuration/79652 "2026-08-18T08:55:15Z")
**Posts on this page:** 1
**Showing post:** 3

<div class="post-metadata">

### Author: ![hugosenari](https://discourse.nixos.org/user_avatar/discourse.nixos.org/hugosenari/32/5630_2.png) [@hugosenari](https://discourse.nixos.org/u/hugosenari)
#### Post date: [August 18, 2026, 5:32pm UTC](https://discourse.nixos.org/t/writing-custom-modules-for-nixos-configuration/79652/3 "2026-08-18T17:32:01Z")

</div>

> [@kazimierzkrauze](#):
>
> Preferred way

Is a subjective mattter 🙂

> [@kazimierzkrauze](#):
>
> more elegant way

Yes, rename files to tailcoat\_suit.nix

Did you know that you can import default.nix by dirname?  
imports = [./system/base];

> [@kazimierzkrauze](#):
>
> declaring custom options

I think, most people don’t create custom options, but custom configs.  
The difference is that “options” you create alternative to others “config” and isn’t hard, is fun, is cool, but most users don’t create them.

> [@kazimierzkrauze](#):
>
> Is this good practice?

Yes

> [@kazimierzkrauze](#):
>
> I tried with this layout

Nice layout, but is important focus on your use case:  
How many user you have, how many packages you have, how many machines you have?  
How much do you think you will need to change them?

For most users a single configuration.nix is enough.

See also:

> [@How do you structure your NixOS configs?](https://discourse.nixos.org/t/how-do-you-structure-your-nixos-configs/65851):
>
> Hey everyone! I’ve been on NixOS for a few months now and I’m trying to figure out the best way to organize my config. I want something that’s simple to understand but can grow with my setup. So far I’ve landed on this structure: ├── flake.nix ├── core/ # System-wide common │ ├── boot.nix │ ├── fonts.nix │ ├── packages.nix │ └── ... ├── home/ # Home Manager common │ ├── hyprland/ │ ├── scripts/ │ ├── firefox.nix │ ├── nvf.nix │ └── ... └─…

---

_[View the full topic](https://discourse.nixos.org/t/writing-custom-modules-for-nixos-configuration/79652)._
