I made this repository to store my own NixOS configurations, but it might be very useful for you as a beginner to have a starting point.
For advanced users, it could be an opportunity to keep their configurations more organized.
If you have any improvement suggestions, don't hesitate: fork the repository and submit a Pull Request.
This repo is organized around three layers. Prefer profiles, add modules as needed, and pick policies carefully.
- Modules: Focused feature blocks, usually in tiers like
base,tools, orfull, for one domain or capability. - Policies: Mutually-exclusive choices that define system behavior (bootloader, desktop, power, firewall, SSH, shells).
- Profiles: Curated bundles of modules for a specific persona or workflow (development, business, creative, gaming, etc.).
First, perform a fresh installation of NixOS.
Then, run:
curl -s https://raw.githubusercontent.com/noksys/genoc/main/bin/install-genoc.sh | sudo bashOr:
nix-shell -p git
sudo su
cd /etc/nixos
git clone git@github.com:noksys/genoc.git
./genoc/bin/install-genoc.shFollow the on-screen instructions.
You can safely run this on an existing NixOS installation. All files inside /etc/nixos will be backed up to /etc/nixos/backup/${timestamp}.
- Clones this repo into
/etc/nixos/genoc - Creates a symlink
/etc/nixos/configuration.nix -> /etc/nixos/genoc/configuration.nix - Copies
custom_machine.example.nixandcustom_vars.example.nixif they do not exist - Adds the
nixos-unstablechannel (for newer packages when needed)
- Edit
/etc/nixos/custom_vars.nix(password hashes, hostname, timezone, etc.) - Edit
/etc/nixos/custom_machine.nixand import yourhardware-configuration.nix - Run
nixos-rebuild switch
Tip: generate password hashes with mkpasswd -m sha-512 (package whois) or another compatible tool.
Note: the smart refresh-rate policy uses X11 xrandr, so it will no-op on Wayland-only sessions.
- Install the package
cachix - Run:
cachix use noksys