aboutsummaryrefslogtreecommitdiffstats
path: root/README.md
blob: 6fd8e29085b69f7cd38c958de9c124ccb93a2bfd (plain) (blame)
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# flake

The configuration files for all of my personal Nix based systems.

## Usage

To setup a system with one of the hosts on the system use `nixos-rebuild`.

```console
$ nixos-rebuild boot --flake $PWD#hostname
```

If you are on a darwin system however, you need to use `darwin-rebuild`.

```console
$ darwin-rebuild switch --flake $PWD#hostname
```

### Adding hosts and users

To add a new host you will want to create a config in `hosts` and add it.

```nix
mkSystem "hostname" {
  user = "username";
  system = "x86_64-linux";
  profile = "nixos";
}
```

For users, simply add a configuration to the `users` directory, it uses hjem.

- `darwin.nix` - the user configuration specifically for **darwin** systems.
- `nixos.nix` - the user configuration specifically for **nixos** systems.

You can look at existing users and hosts to see how they are setup.

## Structure

My flake is structured in a way that is focused on being easy to maintain.

```
flake/
├── .tack/
│   ├── default.nix
│   ├── pins.lock.json
│   └── pins.toml
├── hosts/
│   └── <name>/
│       ├── system/
│       ├── services/
│       └── default.nix
├── lib/
│   ├── modules/
│   │   ├── hjem.nix
│   │   └── nixpkgs.nix
│   └── mksystem.nix
├── pkgs/
│   └── <name>.nix
├── tmpl/
│   └── default/
│       ├── .envrc
│       └── flake.nix
├── users/
│   └── <name>/
│       ├── configs/
│       ├── darwin.nix
│       └── nixos.nix
├── .gitignore
├── LICENSE.txt
└── flake.nix
```