--- title: setup nixos weight: 5 --- {{% hint info %}} This is ***not*** intended to be a NixOS configuration guide. For berevity, I assume you have a fresh NixOS installation. To learn Nix and NixOS, [read this guide](https://nixos-and-flakes.thiscute.world/). {{% /hint %}} {{% hint warning %}} This guide is flake agnostic. I use flakes for my personal setup, but everything in the [self-sufficiency notes](/theses/self-sufficiency/intro-nixos) uses classic modules. You can find my setup [here](https://code.aethrvmn.gr/configs/nix.git). {{% /hint %}} With a fresh NixOS installation, the `configuration.nix` should be in `/etc/nixos/`. Inside that directory, we can make a folder `modules` ```sh $ mkdir modules ``` and make a file `default.nix` inside that folder. ```sh $ touch modules/default.nix ``` then we can just add that to our `configuration.nix` ```nix # /etc/nixos/configuration.nix #... imports = [ #... ./modules #... ]; #... ``` Inside this `modules/` folder is where we will write all the services.