summaryrefslogtreecommitdiff
path: root/content/theses/self-sufficiency/setup-nixos.md
blob: 7c1ee84b73f2012ba1912eca0f570e76cbbd752a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
---
title: setup nixos
weight: 50
---
{{% 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.
Directive (EU) 2019/790, Article 4(3); all rights regarding Text and Data Mining (TDM) are reserved.