My NixOS configuration including hardware, configuration, flake, home manager.
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Charon 5d7e99d27f
All checks were successful
NixOS Update / Evaluate Hosts against flake (push) Successful in 4m15s
NixOS Update / Deploy (dns01) (push) Successful in 4m22s
NixOS Update / Deploy (dock01) (push) Successful in 2m40s
NixOS Update / Deploy (mon01) (push) Successful in 2m47s
chore : flake.lock update
2026-10-28 14:19:08 +01:00
.forgejo/workflows mon01 : adding to auto-upddates 2026-10-15 09:19:05 +02:00
home Full refactor implementing multi-host, multi-user, multi-DE support. 2026-07-14 11:39:06 +08:00
hosts vm01 : fixing typo 2026-10-28 11:17:43 +01:00
modules hawser : removing default settings 2026-10-25 12:21:34 +01:00
secrets restic : fixing typo in json 2026-10-25 11:17:24 +01:00
users charon : adding winbox to the pkgs 2026-10-14 18:59:24 +02:00
.sops.yaml mon01 : refactoring snmp monitoring using snmp generator and file separation to properly handle sops 2026-10-14 15:07:12 +02:00
configuration.nix removing autoUpgrade by default 2026-10-28 11:08:57 +01:00
flake.lock chore : flake.lock update 2026-10-28 14:19:08 +01:00
flake.nix flake : fixing typo 2026-10-28 14:17:15 +01:00
LICENSE Initial commit 2026-07-02 03:12:34 +00:00
README.md reformating the readme 2026-09-15 15:42:03 +02:00

NixOS Configuration

My personal NixOS flake supporting multi-host, multi-user, multi-DE. Each host loading the modules it needs.

[NOTE] If you plan on using it, be careful of removing my ssh keys, autoupdates from this repository...

NixOS Hyprland KDE Plasma

Design

The flake uses mkHost helper that reads hosts/<host>/users.nix to setup the user config and DE if needed. it import only the strict necessary modules / configs.

Each user's config is split into three layers:

Layer Path What goes here
shell users/<user>/home.nix Shell, git, anything usable headless
DE common home/common.nix + modules/desktop/common.nix Common apps for all desktop users
DE custom users/<user>/desktop/<de>.nix User's own DE settings and theming

Repository Structure

NixOS/
├── flake.nix                         # mkHost helper + nixosConfigurations outputs
├── configuration.nix                 # shared system config
│
├── hosts/
│   └── laptop_01/
│       ├── default.nix               # host-specific hardware + services
│       ├── hardware-configuration.nix
│       ├── users.nix                 # where to add the users of a host
│       └── modules/
│           └── gpu-env.nix           # NVIDIA Prime env vars + CUDA btop
│
├── modules/
│   ├── users.nix                     # defines users option
│   └── desktop/
│       ├── sddm.nix                  # display manager, loaded if desktop is present
│       ├── common.nix                # common config for all DE users
│       ├── hyprland-noctalia/
│       │   ├── system.nix            # hyprland programs
│       │   └── home.nix              # UWSM env, Hyprland config, Noctalia
│       ├── kde/
│       │   ├── system.nix            # kde programs
│       │   └── home.nix            
│       └── programs/
│           ├── firefox-system.nix    # programs specific configs
│           └── firefox-home.nix    
│
├── home/
│   └── common.nix                    # headless only fish, starship, btop
│
└── users/
    ├── charon/
    │   ├── system.nix                # NixOS user declaration
    │   ├── home.nix                  # minimal home (username, stateVersion)
    │   └── desktop/
    │       ├── default.nix           # DE layer: personal packages
    │       ├── firefox.nix           
    │       └── hyprland-noctalia.nix # DE specific configuration
    └── peppa/
        ├── system.nix                # minimal configuration for a user
        └── home.nix

How to Use :

This repository is a working repository, you can use it as an example nixos configuration.

For a Template : https://git.self-privacy.eu/Homelab/NixOS-Template

Adding a host :

To add a new host (machine/VM) to this NixOS flake:

1. Create the host directory:

mkdir -p hosts/<hostname>/

Where <hostname> is your machine's identifier (e.g., vm_01, server-01, laptop_02)

2. Add the required configuration files:

required path inside
Yes hosts/<hostname>/default.nix System configuration (services, packages, settings)
Yes hosts/<hostname>/users.nix Users that exist on this host and their desktop preferences
No hosts/<hostname>/hardware-configuration.nix Auto-generated by nixos-generate-config for physical machines, add yours if you already have your config

3. Register the host in the flake:

Open flake.nix and add:

#flake.nix

...

  in {
    nixosConfigurations.<hostname> = mkHost "<hostname>";
  };
}

For example:

nixosConfigurations.vm_01 = mkHost "vm_01";

Adding a user :

The flake uses mkHost helper that reads hosts/<host>/users.nix to setup the user config and DE if needed.

1. create the required user files:

required path inside
Yes users/<name>/system.nix NixOS user declaration
Yes users/<name>/home.nix home-manager config
No, Only if you want a DE users/<name>/desktop/default.nix users/<name>/desktop/<DE_name>.nix Desktop config such as kde, hyprland-noctalia...

2. Register the user in the host's users.nix:

#hosts/<hostname>/users.nix
{
  username = { desktop = null; };  # For headless
  # OR
  username = { desktop = "<DE_name>"; };  # For your DE, must match the .nix in the users/<name>/desktop/<DE_name>.nix
}

This setup allow for multi user, multi DE.


Willing to contact me :

Mail Signal