From 74ae07e84f25672debb06b8854fac72b8b2dd6d8 Mon Sep 17 00:00:00 2001 From: Daniel Langbein Date: Thu, 12 Oct 2023 13:04:19 +0200 Subject: [PATCH] update README --- template/README.md | 58 ++++++++++++++++++++++++++-------------------- 1 file changed, 33 insertions(+), 25 deletions(-) diff --git a/template/README.md b/template/README.md index 33940a4..27201f5 100644 --- a/template/README.md +++ b/template/README.md @@ -1,4 +1,6 @@ -# disko + nixos-anywhere workshop +# disko + nixos-anywhere + +This is an example repo for nixos-anywhere and disko. ## Build installer ISO with SSH @@ -7,40 +9,46 @@ nix-build '' -A config.system.build.isoImage -I nixos-config=iso. ls result/iso/ ``` +## Hardware Configuration + +Boot the target machine into NixOS live ISO. Then execute the following, ideally while connected via SSH: + +```shell +nixos-generate-config --no-filesystems --root /mnt +cat /mnt/etc/nixos/hardware-configuration.nix +``` + +Save the output to a new file in [./hardware-configs/](./hardware-configs/). In [./flake.nix](./flake.nix) replace `./hardware-configs/yodaHP.nix` with it. + +Note: The hardware configuration should not contain any `fileSystems.` options as these are generated based on your disko configuration. + ## Installation -This is an example repo for nixos-anywhere and disko. -It's part of our CCC camp workshop. - To run the interactive vm test run: -``` -nix run github:numtide/nixos-anywhere -- --flake '.#mysystem' --vm-test +```shell +nix --extra-experimental-features nix-command --extra-experimental-features flakes \ + run github:numtide/nixos-anywhere -- -f '.#mysystem' --vm-test ``` -You can also install the vm on some remote system when running +To install on remote target machine: -``` -nix run github:numtide/nixos-anywhere -- --flake '.#mysystem' root@192.168.0.10 +```shell +# GNOME Boxes +#nix --extra-experimental-features nix-command --extra-experimental-features flakes \ +# run github:numtide/nixos-anywhere -- --flake '.#mysystem' -p 2222 root@localhost + +# yodaHP +nix --extra-experimental-features nix-command --extra-experimental-features flakes \ + run github:numtide/nixos-anywhere -- --flake '.#mysystem' -p 22 root@192.168.178.105 ``` +## Updating dependencies -Improve this workshop README: +Recreate the lock file (i.e. update all inputs) and commit the new lock file: -# disko + nixos-anywhere workshop - -This is an example repo for nixos-anywhere and disko. -It's part of our CCC camp workshop. - -To run the interactive vm test run: - -``` -nix run github:numtide/nixos-anywhere -- --flake '.#mysystem' --vm-test -``` - -You can also install the vm on some remote system when running - -``` -nix run github:numtide/nixos-anywhere -- --flake '.#mysystem' root@192.168.0.10 +```shell +nix --extra-experimental-features nix-command --extra-experimental-features flakes \ + flake update --commit-lock-file ```