From 59f36caeb119032bf17a3eaef2c252aa968e8a5a Mon Sep 17 00:00:00 2001 From: Timo Boomers Date: Sat, 17 May 2025 13:33:35 +0200 Subject: [PATCH] changed rpi config --- hosts/p-th-rpi-01/default.nix | 9 ++-- hosts/p-th-rpi-01/disko.nix | 54 -------------------- hosts/p-th-rpi-01/hardware-configuration.nix | 30 ++++++++++- 3 files changed, 33 insertions(+), 60 deletions(-) delete mode 100644 hosts/p-th-rpi-01/disko.nix diff --git a/hosts/p-th-rpi-01/default.nix b/hosts/p-th-rpi-01/default.nix index 1648f16..5156e26 100644 --- a/hosts/p-th-rpi-01/default.nix +++ b/hosts/p-th-rpi-01/default.nix @@ -10,7 +10,6 @@ in { imports = [ ./hardware-configuration.nix - ./disko.nix # Import modules ../../modules/system/default.nix @@ -60,10 +59,10 @@ in ]; }; - boot.loader.grub = { - efiSupport = true; - efiInstallAsRemovable = true; - }; + # Use the extlinux boot loader. (NixOS wants to enable GRUB by default) + boot.loader.grub.enable = false; + # Enables the generation of /boot/extlinux/extlinux.conf + boot.loader.generic-extlinux-compatible.enable = true; services.openssh.enable = true; users.users.root.openssh.authorizedKeys.keys = [ diff --git a/hosts/p-th-rpi-01/disko.nix b/hosts/p-th-rpi-01/disko.nix deleted file mode 100644 index 3c0f1f6..0000000 --- a/hosts/p-th-rpi-01/disko.nix +++ /dev/null @@ -1,54 +0,0 @@ -{ - disko.devices = { - disk.disk1 = { - device = lib.mkDefault "/dev/mmcblk0"; - type = "disk"; - content = { - type = "gpt"; - partitions = { - boot = { - name = "boot"; - size = "1M"; - type = "EF02"; - }; - esp = { - name = "ESP"; - size = "500M"; - type = "EF00"; - content = { - type = "filesystem"; - format = "vfat"; - mountpoint = "/boot"; - }; - }; - root = { - name = "root"; - size = "100%"; - content = { - type = "lvm_pv"; - vg = "pool"; - }; - }; - }; - }; - }; - lvm_vg = { - pool = { - type = "lvm_vg"; - lvs = { - root = { - size = "100%FREE"; - content = { - type = "filesystem"; - format = "ext4"; - mountpoint = "/"; - mountOptions = [ - "defaults" - ]; - }; - }; - }; - }; - }; - }; -} diff --git a/hosts/p-th-rpi-01/hardware-configuration.nix b/hosts/p-th-rpi-01/hardware-configuration.nix index a40df93..8d440bc 100644 --- a/hosts/p-th-rpi-01/hardware-configuration.nix +++ b/hosts/p-th-rpi-01/hardware-configuration.nix @@ -1 +1,29 @@ -throw "Have you forgotten to run nixos-anywhere with `--generate-hardware-config nixos-generate-config ./hardware-configuration.nix`?" +{ config, lib, pkgs, modulesPath, ... }: + +{ + imports = + [ (modulesPath + "/installer/scan/not-detected.nix") + ]; + + boot.initrd.availableKernelModules = [ "xhci_pci" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/44444444-4444-4444-8888-888888888888"; + fsType = "ext4"; + }; + + swapDevices = [ ]; + + # Enables DHCP on each ethernet and wireless interface. In case of scripted networking + # (the default) this is the recommended approach. When using systemd-networkd it's + # still possible to use this option, but it's recommended to use it in conjunction + # with explicit per-interface declarations with `networking.interfaces..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.end0.useDHCP = lib.mkDefault true; + # networking.interfaces.wlan0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "aarch64-linux"; +}