From 758337b75f236a2414efcbf164cd0e63d408b295 Mon Sep 17 00:00:00 2001 From: Christoph Cullmann Date: Sun, 8 Jun 2025 15:41:25 +0200 Subject: [PATCH] remove mini, reinstall that as OpenBSD test machine puffy --- mini/configuration.nix | 18 ----- mini/hardware-configuration.nix | 31 --------- mini/install.txt | 119 -------------------------------- 3 files changed, 168 deletions(-) delete mode 100644 mini/configuration.nix delete mode 100644 mini/hardware-configuration.nix delete mode 100644 mini/install.txt diff --git a/mini/configuration.nix b/mini/configuration.nix deleted file mode 100644 index 6a53dd3..0000000 --- a/mini/configuration.nix +++ /dev/null @@ -1,18 +0,0 @@ -{ config, pkgs, ... }: - -{ - imports = - [ - # Include the results of the hardware scan. - ./hardware-configuration.nix - - # Shared config of all machines - /data/nixos/share/common.nix - ]; - - # our hostname - networking.hostName = "mini"; - - # EurKey layout - services.xserver.xkb.layout = "eu"; -} diff --git a/mini/hardware-configuration.nix b/mini/hardware-configuration.nix deleted file mode 100644 index 2b9e07a..0000000 --- a/mini/hardware-configuration.nix +++ /dev/null @@ -1,31 +0,0 @@ -{ config, lib, pkgs, modulesPath, ... }: - -{ - imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; - - # basic drivers - boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usbhid" "sd_mod" ]; - - # AMD CPU - boot.kernelModules = [ "kvm-amd" ]; - hardware.cpu.amd.updateMicrocode = true; - - # AMD graphics - boot.initrd.kernelModules = [ "amdgpu" ]; - services.ollama.acceleration = "rocm"; - - # /boot efi partition to boot in UEFI mode - fileSystems."/boot" = { - device = "/dev/disk/by-id/nvme-CT4000P3PSSD8_2325E6E63746-part1"; - fsType = "vfat"; - neededForBoot = true; - options = [ "fmask=0022" "dmask=0022" ]; - }; - - # /nix volume with the system & all persistent data - fileSystems."/nix" = { - device = "/dev/disk/by-id/nvme-CT4000P3PSSD8_2325E6E63746-part2:/dev/disk/by-id/ata-CT2000MX500SSD1_2138E5D5061F-part2"; - fsType = "bcachefs"; - neededForBoot = true; - }; -} diff --git a/mini/install.txt b/mini/install.txt deleted file mode 100644 index e868c86..0000000 --- a/mini/install.txt +++ /dev/null @@ -1,119 +0,0 @@ -# -# enable ssh for root -# - -sudo bash -systemctl start sshd -passwd - -# -# install script below -# - -# -# kill old efi boot stuff -# - -efibootmgr -efibootmgr -b 0 -B -efibootmgr -b 1 -B -efibootmgr -b 2 -B -efibootmgr -b 3 -B -efibootmgr -b 4 -B -efibootmgr - -# host name to use -HOST=mini - -# disks to use -DISK=/dev/disk/by-id/nvme-CT4000P3PSSD8_2325E6E63746 -DISK2=/dev/disk/by-id/ata-CT2000MX500SSD1_2138E5D5061F -DISKS="$DISK $DISK2" - -# ensure 4k sector size -nvme format --lbaf=1 --force $DISK -nvme id-ns -H $DISK -sleep 5 - -# create partition table on all disks and EFI partition -RAID="" -for D in $DISKS; do - # kill old data - sgdisk --zap-all $D - blkdiscard -v -f $D - wipefs -a $D - sleep 5 - - # Create partition table - parted $D -- mklabel gpt - - # Create a /boot as $D-part1 - parted $D -- mkpart ESP fat32 1MiB 1024MiB - parted $D -- set 1 boot on - - # Create a /nix as $D-part2 - parted $D -- mkpart NIX 1024MiB 100% - - # boot partition after short sleep, needed on some machines - sleep 5 - mkfs.vfat $D-part1 - - # add part2 to raid - RAID="$RAID $D-part2" -done - -# take a look at the partitions -lsblk - -# create encrypted bcachefs -bcachefs format --encrypt -f $RAID -nix-env -iA nixos.keyutils -keyctl link @u @s -bcachefs unlock $DISK-part2 - -# prepare install, tmpfs root -mount -t tmpfs none /mnt - -# Create directories to mount file systems on -mkdir -p /mnt/{data,nix,boot,root,etc/nixos} - -# mount the ESP -mount $DISK-part1 /mnt/boot - -# mount the /nix -mount -t bcachefs $DISK-part2 /mnt/nix - -# mount the /data via bind mount -mkdir /mnt/nix/data -mount --bind /mnt/nix/data /mnt/data - -# bind mount persistent stuff to data -mkdir -p /mnt/data/{root,nixos/$HOST} -mount --bind /mnt/data/root /mnt/root -mount --bind /mnt/data/nixos/$HOST /mnt/etc/nixos - -# create fake /data to have the right paths -mkdir -p /data -mount --bind /mnt/data /data - -# take a look -mount - -# configure -nixos-generate-config --root /mnt - -# copy config data from another machine including secrets -doas scp -r /data/nixos root@192.168.13.100:/mnt/data - -# install -nixos-install --option experimental-features 'nix-command flakes' --no-root-passwd --root /mnt - -# unmount all stuff and sync -umount -Rl /data /mnt -sync - -# shutdown once -shutdown now - -# sync all /data after the install -doas rsync -va --delete --one-file-system /data/ root@192.168.13.100:/data/