My NixOS desktop config
| assets | ||
| hosts | ||
| modules | ||
| .gitignore | ||
| flake.lock | ||
| flake.nix | ||
| LICENSE | ||
| README.md | ||
Zohiu's NixOS flake
A continuously changing comprehensive collection containing computer configs
Prerequisites
- x86_64 system (I have not bothered to make this work on arm)
- NixOS
- Flakes enabled
Setup
This flake sets up an entire system, including all the apps and devices I use. You will have to edit this quite a lot. Before starting, make sure that you understand the structure of this config and know how to edit it to your liking.
- Clone the repo
- Edit the
flake.nix- make sure theinstall-diris set to the directory you cloned the repo to - Edit the
hosts/to your liking. The username, hostname and first-install-version are really important - make sure to also update the imports inflake.nix - Replace the
hardware.nixof yourhosts/with the generated/etc/nixos/hardware-configuration.nixof your system. If you skip this step, there will be issues. - See Folder Structure
- Run
sudo nixos-rebuild switch --flake <install-dir>#<hostname>(replace with your values) - Reboot
Preview
(miku is optional)
Structure
Design Philosophy
These are not rules. They are just guidelines I try to respect to make my config more modular and easy to work with.
- Everything is a module. Everything needed to make an app work and configure it should be in the same location. This allows hosts to selectively import apps.
- Every module is imported at the root of the config. If you want to do something in home-manager, for example, you have to do it the long way. Look at a module in this repo if you want an example.
- Overrides are preferred. If you need to change a setting in hyprland (like a window rule to make an app work), you should do this in the app's module instead of the hyprland module
- Folder-level imports should always work. If anything is split into subdirectories, importing the root should import all modules contained inside. Every folder needs a
default.nix. - Grouping should be small. If it makes sense to create a subdirectory, it should always be created. That way host imports can be really specific depending on their use-case.