From 8d6594ccd877e194a814f6bccf74feab338c422d Mon Sep 17 00:00:00 2001 From: Martin Wimpress Date: Tue, 15 Oct 2024 22:07:31 +0100 Subject: [PATCH] chore: remove brix and skull --- README.md | 6 - nixos/brix/default.nix | 63 ---------- nixos/brix/disks.nix | 85 -------------- nixos/skull/default.nix | 155 ------------------------ nixos/skull/disk-array.nix | 234 ------------------------------------- nixos/skull/disks.nix | 69 ----------- 6 files changed, 612 deletions(-) delete mode 100644 nixos/brix/default.nix delete mode 100644 nixos/brix/disks.nix delete mode 100644 nixos/skull/default.nix delete mode 100644 nixos/skull/disk-array.nix delete mode 100644 nixos/skull/disks.nix diff --git a/README.md b/README.md index 265de6a01..d9a147223 100644 --- a/README.md +++ b/README.md @@ -29,12 +29,6 @@ These computers are managed by this Nix flake ❄️ | `revan` | [Z390-DESIGNARE] | [Intel Core i9-9900K] | 64GB | Intel UHD Graphics 630 | [NVIDIA T1000] | ☁️ | ❄️ | 🚧 | | `malak` | [B360 HD3P-LM] | [Intel Core i7-8700] | 128GB | Intel UHD Graphics 630 | - | ☁️ | ❄️ | 🚧 | - - Workstation and server host names are Sith Lords and the virtual machines are named after TIE fighter series. Dual boot systems have the NixOS install named a Sith Lord and the *"other"* OS named after their public-facing persona. diff --git a/nixos/brix/default.nix b/nixos/brix/default.nix deleted file mode 100644 index 48cc785f0..000000000 --- a/nixos/brix/default.nix +++ /dev/null @@ -1,63 +0,0 @@ -# Gigabyte GB-BXCEH-2955 (Celeron 2955U: Haswell) - -{ - inputs, - lib, - pkgs, - ... -}: -{ - imports = [ - inputs.nixos-hardware.nixosModules.common-cpu-intel - inputs.nixos-hardware.nixosModules.common-gpu-intel - inputs.nixos-hardware.nixosModules.common-pc - inputs.nixos-hardware.nixosModules.common-pc-ssd - (import ./disks.nix { }) - ]; - - # disko does manage mounting of / /boot /home, but I want to mount by-partlabel - fileSystems."/" = lib.mkForce { - device = "/dev/disk/by-partlabel/root"; - fsType = "xfs"; - options = [ - "defaults" - "relatime" - "nodiratime" - ]; - }; - - fileSystems."/boot" = lib.mkForce { - device = "/dev/disk/by-partlabel/ESP"; - fsType = "vfat"; - }; - - fileSystems."/home" = lib.mkForce { - device = "/dev/disk/by-partlabel/home"; - fsType = "xfs"; - options = [ - "defaults" - "relatime" - "nodiratime" - ]; - }; - - swapDevices = [ - { - device = "/swap"; - size = 2048; - } - ]; - - boot = { - initrd.availableKernelModules = [ - "xhci_pci" - "ehci_pci" - "ahci" - "usbhid" - "uas" - "sd_nod" - ]; - kernelModules = [ "kvm-intel" ]; - kernelPackages = lib.mkDefault pkgs.linuxPackages_5_15; - }; -} diff --git a/nixos/brix/disks.nix b/nixos/brix/disks.nix deleted file mode 100644 index dc42bb2d2..000000000 --- a/nixos/brix/disks.nix +++ /dev/null @@ -1,85 +0,0 @@ -{ - disks ? [ - "/dev/sda" - "/dev/sdb" - ], - ... -}: -let - defaultXfsOpts = [ - "defaults" - "relatime" - "nodiratime" - ]; -in -{ - disko.devices = { - disk = { - sda = { - type = "disk"; - device = builtins.elemAt disks 0; - content = { - type = "table"; - format = "gpt"; - partitions = [ - { - name = "boot"; - start = "0%"; - end = "1M"; - flags = [ "bios_grub" ]; - } - { - name = "ESP"; - start = "1M"; - end = "550MiB"; - bootable = true; - flags = [ "esp" ]; - fs-type = "fat32"; - content = { - type = "filesystem"; - format = "vfat"; - mountpoint = "/boot"; - }; - } - { - name = "root"; - start = "550MiB"; - end = "100%"; - content = { - type = "filesystem"; - # Overwirte the existing filesystem - extraArgs = [ "-f" ]; - format = "xfs"; - mountpoint = "/"; - mountOptions = defaultXfsOpts; - }; - } - ]; - }; - }; - sdb = { - type = "disk"; - device = builtins.elemAt disks 1; - content = { - type = "table"; - format = "gpt"; - partitions = [ - { - name = "home"; - start = "0%"; - end = "100%"; - content = { - type = "filesystem"; - # Overwirte the existing filesystem - extraArgs = [ "-f" ]; - format = "xfs"; - mountpoint = "/home"; - mountOptions = defaultXfsOpts; - }; - } - ]; - }; - }; - }; - }; -} diff --git a/nixos/skull/default.nix b/nixos/skull/default.nix deleted file mode 100644 index dc7ddd718..000000000 --- a/nixos/skull/default.nix +++ /dev/null @@ -1,155 +0,0 @@ -# Intel Skull Canyon NUC6i7KYK -# - https://github.com/rm-hull/skull-canyon -{ inputs, lib, ... }: -{ - imports = [ - inputs.nixos-hardware.nixosModules.common-cpu-intel - inputs.nixos-hardware.nixosModules.common-gpu-intel - inputs.nixos-hardware.nixosModules.common-pc - inputs.nixos-hardware.nixosModules.common-pc-ssd - (import ./disks.nix { }) - ]; - - # disko does manage mounting of / /boot /home, but I want to mount by-partlabel - fileSystems."/" = lib.mkForce { - device = "/dev/disk/by-partlabel/root"; - fsType = "xfs"; - options = [ - "defaults" - "relatime" - "nodiratime" - ]; - }; - - fileSystems."/boot" = lib.mkForce { - device = "/dev/disk/by-partlabel/ESP"; - fsType = "vfat"; - }; - - fileSystems."/home" = lib.mkForce { - device = "/dev/disk/by-partlabel/home"; - fsType = "xfs"; - options = [ - "defaults" - "relatime" - "nodiratime" - ]; - }; - - fileSystems."/mnt/sonnet" = lib.mkForce { - device = "/dev/md/TS4p1"; - fsType = "xfs"; - options = [ - "defaults" - "relatime" - "nodiratime" - ]; - }; - - swapDevices = [ - { - device = "/swap"; - size = 2048; - } - ]; - - boot = { - initrd.availableKernelModules = [ - "xhci_pci" - "nvme" - "usbhid" - "uas" - "sd_mod" - ]; - kernelModules = [ "kvm-intel" ]; - swraid = { - enable = true; - mdadmConf = "PROGRAM=true"; - }; - }; - - services = { - # Home LAN DNS server - # - https://l33tsource.com/blog/2023/06/18/dnsmasq-on-NixOS-2305/ - dnsmasq = { - enable = true; - alwaysKeepRunning = true; - # Use AdGuard Public DNS with family protection filters - # - https://adguard-dns.io/en/public-dns.html - settings.server = [ - "94.140.14.15" - "94.140.15.16" - ]; - settings = { - cache-size = 500; - }; - }; - netdata = { - enable = true; - package = pkgs.netdataCloud; - }; - plex = { - enable = true; - dataDir = "/mnt/sonnet/State/plex"; - openFirewall = true; - }; - prowlarr = { - enable = true; - openFirewall = true; - }; - radarr = { - enable = true; - dataDir = "/mnt/sonnet/State/radarr"; - openFirewall = true; - }; - sonarr = { - enable = true; - dataDir = "/mnt/sonnet/State/sonarr"; - openFirewall = true; - }; - samba = { - enable = true; - securityType = "user"; - extraConfig = '' - workgroup = WIMPRESS.IO - server string = Skull - netbios name = Skull - security = user - #use sendfile = yes - #max protocol = smb2 - # note: localhost is the ipv6 localhost ::1 - hosts allow = 192.168.2. 192.168.192. 127.0.0.1 localhost - hosts deny = 0.0.0.0/0 - guest account = nobody - map to guest = bad user - ''; - shares = { - Films = { - path = "/mnt/sonnet/Films"; - browseable = "yes"; - "read only" = "no"; - "guest ok" = "yes"; - "create mask" = "0644"; - "directory mask" = "0755"; - "force user" = "$username"; - "force group" = "$username"; - }; - Films_Kids = { - path = "/mnt/sonnet/Films_Kids"; - browseable = "yes"; - "read only" = "no"; - "guest ok" = "yes"; - "create mask" = "0644"; - "directory mask" = "0755"; - "force user" = "$username"; - "force group" = "$username"; - }; - }; - }; - tautulli = { - enable = true; - dataDir = "/mnt/sonnet/State/tautulli"; - openFirewall = true; - }; - }; -} diff --git a/nixos/skull/disk-array.nix b/nixos/skull/disk-array.nix deleted file mode 100644 index 6fa7dd5e9..000000000 --- a/nixos/skull/disk-array.nix +++ /dev/null @@ -1,234 +0,0 @@ -# nix shell nixpkgs#gptfdisk - -# Disk zipper `skull-wipe-array.sh` in the scripts directory -# sudo nix run github:nix-community/disko -- --mode zap_create_mount ./disk-array.nix -# sudo nix run github:nix-community/disko -- --mode format ./disk-array.nix -# sudo nix run github:nix-community/disko -- --mode mount ./disk-array.nix - -# Simple sequential write test -# echo 3 | sudo tee /proc/sys/vm/drop_caches -# dd if=/dev/zero of=./test bs=1M count=10240 conv=fdatasync,notrunc status=progress - -# This is becuase is turned out one of the PCI adapters was faulty and I was chasing my tail for a while. -# Find faulty ATA -# dmesg | grep FPDMA | cut -d']' -f2- | sort -u' -# Resolve ATA to drive -# ata=3; ls -l /sys/block/sd* | grep $(grep $ata /sys/class/scsi_host/host*/unique_id | awk -F'/' '{print $5}')') -# ls -l /sys/block/sd* | sed 's/.*\(sd.*\) -.*\(ata.*\)\/h.*/\2 => \1/' -# Watch for errors with: dmesg -wH - -# Middle Card (x8): 4x Transcend MTS830S 4TB -#/dev/disk/by-id/ata-TS4TMTS830S_H986540082 (SATA-1) -#/dev/disk/by-id/ata-TS4TMTS830S_H986540080 (SATA-2) -#/dev/disk/by-id/ata-TS4TMTS830S_H986540076 (SATA-3) -#/dev/disk/by-id/ata-TS4TMTS830S_H986540074 (SATA-4) - -# Bottom Card (x8): 4x Transcend MTS830S 4TB -#/dev/disk/by-id/ata-TS4TMTS830S_H738980002 (SATA-1) -#/dev/disk/by-id/ata-TS4TMTS830S_H760910071 (SATA-2) -#/dev/disk/by-id/ata-TS4TMTS830S_H760910070 (SATA-3) -#/dev/disk/by-id/ata-TS4TMTS830S_H760910072 (SATA-4) - -{ - disks ? [ - "/dev/disk/by-id/ata-TS4TMTS830S_H986540082" - "/dev/disk/by-id/ata-TS4TMTS830S_H986540080" - "/dev/disk/by-id/ata-TS4TMTS830S_H986540076" - "/dev/disk/by-id/ata-TS4TMTS830S_H986540074" - "/dev/disk/by-id/ata-TS4TMTS830S_H738980002" - "/dev/disk/by-id/ata-TS4TMTS830S_H760910071" - "/dev/disk/by-id/ata-TS4TMTS830S_H760910070" - "/dev/disk/by-id/ata-TS4TMTS830S_H760910072" - ], - ... -}: -let - defaultXfsOpts = [ - "defaults" - "relatime" - "nodiratime" - ]; -in -{ - disko.devices = { - disk = { - TS4-1 = { - type = "disk"; - device = builtins.elemAt disks 0; - content = { - type = "table"; - format = "gpt"; - partitions = [ - { - name = "MID-SATA1"; - start = "0%"; - end = "100%"; - content = { - type = "mdraid"; - name = "TS4"; - }; - } - ]; - }; - }; - TS4-2 = { - type = "disk"; - device = builtins.elemAt disks 1; - content = { - type = "table"; - format = "gpt"; - partitions = [ - { - name = "MID-SATA2"; - start = "0%"; - end = "100%"; - content = { - type = "mdraid"; - name = "TS4"; - }; - } - ]; - }; - }; - TS4-3 = { - type = "disk"; - device = builtins.elemAt disks 2; - content = { - type = "table"; - format = "gpt"; - partitions = [ - { - name = "MID-SATA3"; - start = "0%"; - end = "100%"; - content = { - type = "mdraid"; - name = "TS4"; - }; - } - ]; - }; - }; - TS4-4 = { - type = "disk"; - device = builtins.elemAt disks 3; - content = { - type = "table"; - format = "gpt"; - partitions = [ - { - name = "MID-SATA4"; - start = "0%"; - end = "100%"; - content = { - type = "mdraid"; - name = "TS4"; - }; - } - ]; - }; - }; - TS4-5 = { - type = "disk"; - device = builtins.elemAt disks 4; - content = { - type = "table"; - format = "gpt"; - partitions = [ - { - name = "BOT-SATA1"; - start = "0%"; - end = "100%"; - content = { - type = "mdraid"; - name = "TS4"; - }; - } - ]; - }; - }; - TS4-6 = { - type = "disk"; - device = builtins.elemAt disks 5; - content = { - type = "table"; - format = "gpt"; - partitions = [ - { - name = "BOT-SATA2"; - start = "0%"; - end = "100%"; - content = { - type = "mdraid"; - name = "TS4"; - }; - } - ]; - }; - }; - TS4-7 = { - type = "disk"; - device = builtins.elemAt disks 6; - content = { - type = "table"; - format = "gpt"; - partitions = [ - { - name = "BOT-SATA3"; - start = "0%"; - end = "100%"; - content = { - type = "mdraid"; - name = "TS4"; - }; - } - ]; - }; - }; - TS4-8 = { - type = "disk"; - device = builtins.elemAt disks 7; - content = { - type = "table"; - format = "gpt"; - partitions = [ - { - name = "BOT-SATA4"; - start = "0%"; - end = "100%"; - content = { - type = "mdraid"; - name = "TS4"; - }; - } - ]; - }; - }; - }; - mdadm = { - TS4 = { - type = "mdadm"; - level = 6; - content = { - type = "table"; - format = "gpt"; - partitions = [ - { - name = "primary"; - start = "0%"; - end = "100%"; - content = { - type = "filesystem"; - # Overwirte the existing filesystem - extraArgs = [ "-f" ]; - format = "xfs"; - mountpoint = "/mnt/TS4"; - mountOptions = defaultXfsOpts; - }; - } - ]; - }; - }; - }; - }; -} diff --git a/nixos/skull/disks.nix b/nixos/skull/disks.nix deleted file mode 100644 index 278f9a77c..000000000 --- a/nixos/skull/disks.nix +++ /dev/null @@ -1,69 +0,0 @@ -_: { - disko.devices = { - disk = { - nvme0 = { - type = "disk"; - device = "/dev/nvme0n1"; - content = { - type = "table"; - format = "gpt"; - partitions = [ - { - name = "ESP"; - start = "0%"; - end = "550MiB"; - bootable = true; - flags = [ "esp" ]; - fs-type = "fat32"; - content = { - type = "filesystem"; - format = "vfat"; - mountpoint = "/boot"; - }; - } - { - name = "root"; - start = "550MiB"; - end = "100%"; - content = { - type = "filesystem"; - # Overwirte the existing filesystem - extraArgs = [ "-f" ]; - format = "xfs"; - mountpoint = "/"; - mountOptions = [ - "defaults" - "relatime" - "nodiratime" - ]; - }; - } - ]; - }; - }; - nvme1 = { - type = "disk"; - device = "/dev/nvme1n1"; - content = { - type = "table"; - format = "gpt"; - partitions = [ - { - name = "home"; - start = "0%"; - end = "100%"; - content = { - type = "filesystem"; - # Overwirte the existing filesystem - extraArgs = [ "-f" ]; - format = "xfs"; - mountpoint = "/home"; - mountOptions = defaultXfsOpts; - }; - } - ]; - }; - }; - }; - }; -}