Bring readme up to date

This commit is contained in:
Sandro - 2023-05-04 17:02:14 +02:00
parent e21735d109
commit a96218b068
Signed by: sandro
GPG Key ID: 3AF5A43A3EECC2E5
1 changed files with 10 additions and 58 deletions

View File

@ -20,8 +20,9 @@ echo 'experimental-features = nix-command flakes' >> ~/.config/nix/nix.conf
## Enable nix flakes system wide (preferred for NixOS)
add this to your NixOS configuration:
```nix
nix.settings.experimental-features = "nix-command flakes";
nix.settings.experimental-features = [ "nix-command" "flakes" ];
```
### The secrets repo
@ -51,6 +52,8 @@ For every host that has a `nixosConfiguration` in our Flake, there are two scrip
trusted-substituters = https://nix-cache.hq.c3d2.de
```
This can also be set with the `c3d2.addBinaryCache` option from the [c3d2-user-module](https://gitea.c3d2.de/c3d2/nix-user-module).
### Checking for updates
```shell
@ -232,65 +235,14 @@ This is necessary, so you can login to any machine with your gpg key.
## Laptops / Desktops
This repository contains a NixOS module that can be used with personal machines
as well. This module appends `/etc/ssh/ssh_known_hosts` with the host keys of
registered HQ hosts, and optionally appends `/etc/hosts` with static IPv6
addresses local to HQ. Simply import the `lib` directory to use the module. As
an example:
This repo could be used in the past as a module. While still technically possible, it is not recommended
because the amounts of flake inputs highly increased and the modules are not designed with that in mind.
```nix
# /etc/nixos/configuration.nix
{ config, pkgs, lib, ... }:
let
# Using a flake is recommended instead
c3d2Config = builtins.fetchGit { url = "https://gitea.c3d2.de/C3D2/nix-config.git"; };
in {
imports = [
"${c3d2Config}/modules/c3d2.nix"
];
For end user modules take a look at the [c3d2-user-module](https://gitea.c3d2.de/c3d2/nix-user-module).
c3d2 = {
...
};
}
```
For the deployment options take a look at [deployment](https://gitea.c3d2.de/c3d2/deployment).
## Server zfs setup
## ZFS setup
For the other steps follow https://nixos.org/manual/nixos/unstable/index.html#sec-installation
Please refer to [disko](./disko)
```
sgdisk --zap-all /dev/sda
parted /dev/sda -- mklabel gpt
parted /dev/sda -- mkpart primary 512MB -40GB
parted /dev/sda -- mkpart primary linux-swap -40GB 100%
parted /dev/sda -- mkpart ESP fat32 1MB 512MB
parted /dev/sda -- set 3 esp on
mkswap -L swap /dev/sda2
mkfs.fat -F 32 -n boot /dev/sda3
pool create \
-o ashift=12 \
-o autotrim=on \
-R /mnt \
-O acltype=posixacl \
-O canmount=off \
-O compression=zstd \
-O dnodesize=auto \
-O normalization=formD \
-O relatime=on \
-O xattr=sa \
-O mountpoint=/ \
hydra /dev/sda1
zfs create -o canmount=on -o mountpoint=/ hydra/nixos
zfs create -o canmount=on -o mountpoint=/nix hydra/nixos/nix
zfs create -o canmount=on -o atime=off -o mountpoint=/nix/store hydra/nixos/nix/store
zfs create -o canmount=on -o mountpoint=/nix/var hydra/nixos/nix/var
zfs create -o canmount=off -o mountpoint=none hydra/data
zfs create -o canmount=on -o mountpoint=/etc hydra/data/etc
zfs create -o canmount=on -o mountpoint=/var hydra/data/var
zfs create -o canmount=on -o mountpoint=/var/backup hydra/data/var/backup
zfs create -o canmount=on -o mountpoint=/var/lib hydra/data/var/lib
zfs create -o canmount=on -o mountpoint=/var/log hydra/data/var/log
zfs create -o canmount=on -o mountpoint=/home hydra/data/home
zfs create -o canmount=off -o mountpoint=none -o refreservation=1G hydra/reserved
```