How The Config Files Work
Table of Contents
ZaneyOS 2.3 Docs - This article is part of a series.
The way the files are structured is quite simple. The repository top level has the Gitlab specific files and flake(.nix
and .lock
) files, the hosts
folder for separate host configurations, the modules
folder which has the core
folder for system configuration and the home
folder for home manager configuration. That means we have the normal configuration files, mine are just shortened names such as hardware.nix instead of hardware-configuration.nix down in the hosts/<your-hostname>
folder.
The flake.nix file has variables for hostname, username, and profile. These are all used to setup the system correctly. Your profile ensures graphics settings/drivers are setup.
Here is how the files all get imported:
flake.nix > profiles/(the profile selected) > hosts/(hostname spefified) > modules/core/(the user.nix sets up homemanager and imports) > modules/home/
Below you’ll see the file structure:
├── hosts
│ └── default
│ ├── hardware.nix
│ ├── host-packages.nix
│ ├── variables.nix
│ └── ...
├── modules
│ ├── core
│ │ ├── default.nix
│ │ ├── packages.nix
│ │ └── ...
│ ├── home
│ │ ├── default.nix
│ │ ├── kitty.nix
│ │ └── ...
│ └── ...
├── profiles
│ ├── amd
│ ├── nvidia
│ └── ...
├── flake.nix
├── flake.lock
├── README.md
└── ...
🖋️ Why Have Config Files In Different Syntax!? #
Having the configuration files as a .nix
file allows me to use the
Nix language to generate the actual desired config file. This allows me to use Stylix, a phenomenal tool in NixOS, to define a colorscheme and let the user change the theme and have all the programs change upon rebuild. Even GTK applications change too!