From c3a3d8a12a3527c16073423d2f81f8690f7a0b0d Mon Sep 17 00:00:00 2001 From: Simon Bruder Date: Tue, 4 May 2021 21:37:52 +0200 Subject: [PATCH] Adapt documentation to current configuration --- README.md | 24 ++++++++++++------------ machines/installation/configuration.nix | 23 ----------------------- 2 files changed, 12 insertions(+), 35 deletions(-) delete mode 100644 machines/installation/configuration.nix diff --git a/README.md b/README.md index 5d6024b..3c0a12e 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,6 @@ ## Structure - * `deploy.nix`: Configuration for deployment with - [krops](https://cgit.krebsco.de/krops/about/) * `machines`: Machine-specific configuration + `README.md`: Short overview of the hardware and usage of the machine + `configuration.nix`: Main configuration @@ -25,6 +23,9 @@ Secrets are managed with [sops-nix](https://github.com/Mic92/sops-nix). +Machines can be deployed with `nix run .#deploy/hostname`, LUKS encrypted +systems can be unlocked over network with `nix run .#unlock/hostname`. + ## How to install This guide describes how to install this configuration with GPT and BIOS boot. @@ -66,7 +67,7 @@ the following after opening the luks partition: `vgchange -ay`. Create filesystems: mkfs.ext2 /dev/sdX2 - mkfs.ext4 -L root /dev/HOSTNAME-vg/root + mkfs.btrfs -L root /dev/HOSTNAME-vg/root mkswap -L swap /dev/HOSTNAME-vg/swap Mount the file systems and activate swap: @@ -82,22 +83,21 @@ this machine): nixos-generate-config --root /mnt/ -Modify the hardware configuration as needed. Fill in the fields that have -comments in `machines/installation/configuration.nix` and copy it to -`/mnt/etc/nixos/configuration.nix`. +Modify the hardware configuration as needed and add it to the machine +configuration in this repository. If necessary, create the machine +configuration first by basing it on an already existing configuration and +adding an entry to `machines/default.nix`. Then copy this repository to the +target machine and run (`--impure` is needed since `/mnt/nix/store` is not in +`/nix/store`): -Install NixOS: - - nixos-install + nixos-install --impure --flake /path/to/repository#hostname Add the krops sentinel file: mkdir -p /mnt/var/src touch /mnt/var/src/.populate -After the successful instalation, reboot use `deploy HOSTNAME` on another -system to deploy the new system using krops, after adding the -`configuration.nix` and entry in `machines/default.nix` for the machine. +Reboot. ## License diff --git a/machines/installation/configuration.nix b/machines/installation/configuration.nix deleted file mode 100644 index d546733..0000000 --- a/machines/installation/configuration.nix +++ /dev/null @@ -1,23 +0,0 @@ -{ config, pkgs, ... }: - -{ - imports = [ - ./hardware-configuration.nix - ]; - - networking.useDHCP = false; - # replace with actual network interface - networking.interfaces.eno1.useDHCP = true; - - environment.systemPackages = with pkgs; [ - git # required by krops - ]; - - services.openssh.enable = true; - - users.users.root.openssh.authorizedKeys.keys = [ - # add ssh keys required for initial deployment with krops - ]; - - console.keyMap = "de"; -}