From 8f9bc0b01a461aa891ddb11cc35fa0eb9c0d131d Mon Sep 17 00:00:00 2001 From: Joris Date: Sun, 31 Mar 2024 22:52:05 +0200 Subject: Specify concole instead of sh or bash --- README.md | 70 +++++++++++++++++++++++++++++++-------------------------------- 1 file changed, 35 insertions(+), 35 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index d13ba67..26abbd0 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ Download NixOS ISO at https://nixos.org/download.html. Write ISO to a USB stick: - ```sh + ```console sudo dd if=nix.iso of=/dev/sdX bs=4M status=progress ``` @@ -19,7 +19,7 @@ Boot from the USB stick on the target machine. Connect as sudo: - ```sh + ```console sudo su ``` @@ -44,14 +44,14 @@ Launch `gdisk /dev/`: Encrypt your disk and open it: - ```sh + ```console cryptsetup luksFormat /dev/ cryptsetup luksOpen /dev/ crypted ``` Create swap and root logical volumes: - ```sh + ```console pvcreate /dev/mapper/crypted vgcreate vg /dev/mapper/crypted lvcreate -L G -n swap vg @@ -60,7 +60,7 @@ Create swap and root logical volumes: Format the partitions: - ```sh + ```console mkfs.fat -F 32 -n BOOT /dev/ mkfs.ext4 -L nixos /dev/vg/root mkswap -L swap /dev/vg/swap @@ -68,7 +68,7 @@ Format the partitions: Mount partitions - ```sh + ```console mount /dev/vg/root /mnt mkdir /mnt/boot mount /dev/ /mnt/boot @@ -79,25 +79,25 @@ Mount partitions Note your wifi interface: - ```sh + ```console ifconfig ``` Scan available ESSID with: - ```sh + ```console iwlist scan | grep ESSID ``` Write `wpa_supplicant` configuration: - ```sh + ```console wpa_passphrase | sudo tee /etc/wpa_supplicant.conf ``` Start `wpa_supplicant`: - ```sh + ```console wpa_supplicant -B -i -c /etc/wpa_supplicant.conf ``` @@ -105,7 +105,7 @@ Start `wpa_supplicant`: Generate configuration: - ```sh + ```console nixos-generate-config --root /mnt ``` @@ -152,25 +152,25 @@ Complete `/mnt/etc/nixos/configuration.nix` Install: - ```sh + ```console nixos-install ``` Set user password: - ```sh + ```console passwd joris ``` Reboot: - ```sh + ```console reboot ``` If the system doesn’t boot, boot from the USB key, and: - ```sh + ```console sudo su cryptsetup luksOpen /dev/ crypted lvchange -a y /dev/vg/swap @@ -186,7 +186,7 @@ Plug in recuperation key and check label with `lsblk`. Decrypt and mount private backup: - ```sh + ```console sudo cryptsetup luksOpen /dev/XXX secrets sudo mkdir encrypted-storage sudo mount /dev/mapper/secrets encrypted-storage @@ -194,33 +194,33 @@ Decrypt and mount private backup: Import: - ```sh + ```console gpg --import encrypted-storage/pubkey.asc gpg --allow-secret-key-import --import encrypted-storage/privkey.asc ``` Trust: - ```sh + ```console gpg --edit-key joris@guyonvarch.me gpg> trust ``` Write SSH keygrip in `~/.gnupg/sshcontrol`: - ```sh + ```console gpg2 -K --with-keygrip # [A] keygrip ``` Verify that SSH key is available: - ```sh + ```console ssh-add -L ``` Unmount and close the encrypted volume: - ```bash + ```console sudo umount encrypted-storage/ sudo cryptsetup luksClose secret ``` @@ -231,19 +231,19 @@ Unplug the volume. Connect to Internet: - ```sh + ```console nmtui ``` Install git: - ```sh + ```console nix-env -i git ``` Clone the configuration: - ```sh + ```console git clone git@guyonvarch.me:/home/git/config /home/joris/code/config cd code/config git checkout main @@ -253,14 +253,14 @@ Extract the system’s `hardware-configuration.nix`, and add it to `./hosts/jori Move aside the previous configuration: - ```sh + ```console cp -r /etc/nixos config-old sudo rm -rf /etc/nixos ``` Link `/etc/nixos` to the configuration: - ```sh + ```console sudo ln -s /home/joris/code/config /etc/nixos ``` @@ -272,7 +272,7 @@ Remove `.gnupg/.sshcontrol` Build: - ```sh + ```console nixos-rebuild switch ``` @@ -280,25 +280,25 @@ Build: Create user directories: - ```sh + ```console mkdir code documents downloads music pictures videos ``` Create `.less` to setup less keybindings from `.lesskey`: - ```sh + ```console lesskey ``` Setup password store: - ```sh + ```console git clone git@guyonvarch.me:/home/git/password-store.git .password-store ``` Get documents: - ```sh + ```console duplicity restore rsync://guyonvarch.me/~/backups/documents documents ``` @@ -306,14 +306,14 @@ Get documents: Look at user services: - ```sh + ```console systemctl --user list-units systemctl --user list-timers --all ``` If services do not appear, run: - ```sh + ```console systemctl --user daemon-reload ``` @@ -321,7 +321,7 @@ If services do not appear, run: “OpenGL renderer string” should not be llvm: - ```sh + ```console nix-shell -p glxinfo --run "glxinfo | grep OpenGL" ``` @@ -331,7 +331,7 @@ In order to link a device, use `cobang` to get the link from the QR code. Then run: - ```sh + ```console signal-cli addDevice --uri "uri" ``` -- cgit v1.2.3