Open PedroRegisPOAR opened 3 years ago
ISO_NAME='nixos-minimal-22.05.1043.5afb1b7dcf4-x86_64-linux.iso'
test -f $ISO_NAME \
|| wget https://releases.nixos.org/nixos/22.05/$ISO_NAME
EXPECTED_256SUM='9a47bd1b8cc86ec966a008196ac1f7fe1099104dba345b73a1a4dad97c6b6f33'
echo $EXPECTED_256SUM' '$ISO_NAME | sha256sum -c
rm -fv nixos.qcow2
qemu-img create -f qcow2 nixos.qcow2 10G
qemu-kvm \
-m 3G \
-nic user \
-boot d \
-cdrom $ISO_NAME \
-hda nixos.qcow2 \
-enable-kvm \
-cpu host \
-smp $(nproc)
WIP:
rm -fv nixos.qcow2
qemu-img create -f qcow2 nixos.qcow2 10G
qemu-kvm \
-m 3G \
-nic user \
-boot d \
-cdrom $ISO_NAME \
-hda nixos.qcow2 \
-enable-kvm \
-cpu host \
-smp $(nproc) \
-net nic,model=virtio \
-net user,hostfwd=tcp:127.0.0.1:9000-:9000 \
-device virtio-gpu-pci \
-device virtio-keyboard-pci
TODO: document it https://t.me/nixosbrasil/45184
nix shell nixpkgs#ventoy-bin-full
lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
sda 8:0 0 465.8G 0 disk
├─sda1 8:1 0 7.4G 0 part
├─sda2 8:2 0 139.7G 0 part
├─sda3 8:3 0 513M 0 part
└─sda4 8:4 0 318.1G 0 part
sdb 8:16 0 111.8G 0 disk
├─sdb1 8:17 0 512M 0 part /boot/efi
└─sdb2 8:18 0 111.3G 0 part /nix/store
/
sr0 11:0 1 1024M 0 rom
zram0 253:0 0 1.5G 0 disk [SWAP]
Plug the USB stick, and run again:
lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
sda 8:0 0 465.8G 0 disk
├─sda1 8:1 0 7.4G 0 part
├─sda2 8:2 0 139.7G 0 part
├─sda3 8:3 0 513M 0 part
└─sda4 8:4 0 318.1G 0 part
sdb 8:16 0 111.8G 0 disk
├─sdb1 8:17 0 512M 0 part /boot/efi
└─sdb2 8:18 0 111.3G 0 part /nix/store
/
sdc 8:32 1 28.9G 0 disk
└─sdc1 8:33 1 28.9G 0 part
sr0 11:0 1 1024M 0 rom
zram0 253:0 0 1.5G 0 disk [SWAP]
sudo $(which ventoy) -i /dev/sdc
https://nixos.org/download.html https://releases.nixos.org/nixos/22.11/nixos-22.11.2203.285b3ff0660
https://ubuntu.com/download/desktop
https://getfedora.org/pt_BR/workstation/download/ https://getfedora.org/pt_BR/security/
https://alpinelinux.org/downloads/
https://wiki.centos.org/HowTos/InstallFromUSBkey https://www.centos.org/download/ http://mirror.uepg.br/centos/7/isos/x86_64/
https://www.debian.org/CD/live/ https://www.debian.org/CD/verify
For tests https://www.microsoft.com/pt-br/software-download/windows11
ISO_NAME='nixos-plasma5-22.11.2203.285b3ff0660-x86_64-linux.iso'
URL_ISO='https://releases.nixos.org/nixos/22.11/nixos-22.11.2203.285b3ff0660/'"$ISO_NAME"
test -f "$ISO_NAME" || wget "$URL_ISO"
test -f "$ISO_NAME".sha256 || wget "$URL_ISO".sha256
cat "$ISO_NAME".sha256 | sha256sum -c
ISO_NAME='ubuntu-22.04.1-desktop-amd64.iso'
URL_ISO='https://releases.ubuntu.com/22.04.1/'"$ISO_NAME"
test -f "$ISO_NAME" || wget "$URL_ISO"
echo c396e956a9f52c418397867d1ea5c0cf1a99a49dcf648b086d2fb762330cc88d' '"$ISO_NAME" | sha256sum -c
ISO_NAME='Fedora-Workstation-Live-x86_64-37-1.7.iso'
URL_CHECKSUM='https://getfedora.org/static/checksums/37/iso/Fedora-Workstation-37-1.7-x86_64-CHECKSUM'
URL_ISO='https://download.fedoraproject.org/pub/fedora/linux/releases/37/Workstation/x86_64/iso/'"$ISO_NAME"
test -f "$ISO_NAME" || wget "$URL_ISO"
test -f "$ISO_NAME"-CHECKSUM || wget "$URL_CHECKSUM"
echo 9c69005baafdba6e4ff04c1cf4779121b7fc9aacab80b4633394576da336a515' '"$ISO_NAME" | sha256sum -c
ISO_NAME='alpine-standard-3.17.1-x86.iso'
URL_ISO='https://dl-cdn.alpinelinux.org/alpine/v3.17/releases/x86/'"$ISO_NAME"
test -f "$ISO_NAME" || wget "$URL_ISO"
test -f "$ISO_NAME".sha256 || wget "$URL_ISO".sha256
cat "$ISO_NAME".sha256 | sha256sum -c
ISO_NAME='CentOS-7-x86_64-DVD-2009.iso'
BASE_URL='http://mirror.uepg.br/centos/7/isos/x86_64/'
URL_ISO="$BASE_URL""$ISO_NAME"
test -f "$ISO_NAME" || wget "$URL_ISO"
test -f sha256sum.txt || wget "$BASE_URL"sha256sum.txt
echo e33d7b1ea7a9e2f38c8f693215dd85254c3a4fe446f93f563279715b68d07987' '"$ISO_NAME" | sha256sum -c
ISO_NAME='debian-11.6.0-amd64-netinst.iso'
URL_ISO='https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/'"$ISO_NAME"
test -f "$ISO_NAME" || wget "$URL_ISO"
NIXPKGS_ALLOW_INSECURE=1 nix run --impure nixpkgs#etcher
Installation
Really useful: https://releases.nixos.org/?prefix=nixos/22.05/
TODO: Part 0, could merge the injection of the flag
--extra-experimental-features 'nix-command flakes'
Part 1: should work in almost every place, only needed nix CLI working (tested it in Ubuntu 20.04)
Part 2: downloading some fixed/pinned url's NixOS ISO and testing its sha256sum
Part 3: making an bootable flash drive/USB stick
From:
Part 4: install it using the Calamares graphical installer
Part 5: after the install just copy paste
Once I got this erros, and I was willing to save time, so pressed
Ctrl + c
:And re run the last command.
Part 6: after the reboot, lets generate an new key to be able to use git via ssh
Go to: https://github.com/settings/ssh/new
Optional, but recommended:
Part 7: removes the backup folder and push to the remote the new
hardware-configuration.nix
Troubleshooting
Am I booted in Legacy or UEFI?
From: https://nixos.wiki/wiki/Bootloader
Not needed
https://www.youtube.com/watch?v=aeDbYuJyXr8&t=43s
I was being hitted by a really annoying permission denied error.
Solution:
Generalise?
https://github.com/tfc/nixos-offline-installer#how-to-test-in-qemu
https://search.nixos.org/options?channel=22.05&show=system.copySystemConfiguration&from=0&size=50&sort=relevance&type=packages&query=copySystemConfiguration
https://discourse.nixos.org/t/declarative-kde-configuration/15901/5