diff --git a/hosts/rock5b/default.nix b/hosts/rock5b/default.nix index fbee320..3bb0a6b 100644 --- a/hosts/rock5b/default.nix +++ b/hosts/rock5b/default.nix @@ -6,21 +6,27 @@ config, ... }: { - imports = - [ - ./hardware-configuration.nix - ] - ++ (fleetModules [ - "common" - "ssh" - "ccr" - "cgit" - ]); + imports = fleetModules [ + "common" + "ssh" + "ccr" + ]; ccr.enable = true; services.rock5b-fan-control.enable = true; + nixpkgs.hostPlatform = "aarch64-linux"; + + swapDevices = []; + + boot.loader = { + grub.enable = false; + generic-extlinux-compatible.enable = true; + }; + + disko.devices = import ./disko.nix {}; + services.nginx.enable = true; services.nginx.virtualHosts."localhost" = { cgit = { diff --git a/hosts/rock5b/disko.nix b/hosts/rock5b/disko.nix new file mode 100644 index 0000000..9475fef --- /dev/null +++ b/hosts/rock5b/disko.nix @@ -0,0 +1,35 @@ +{emmc ? "/dev/mmcblk0", ...}: { + disko.devices = { + disk = { + emmc = { + type = "disk"; + device = emmc; + content = { + type = "table"; + format = "gpt"; + partitions = [ + { + type = "partition"; + start = "32.8kB"; + end = "12.6MB"; + name = "uboot"; + bootable = true; + } + { + type = "partition"; + name = "NIXOS_ROOTFS"; + start = "13.6MB"; + end = "100%"; + flags = ["legacy_boot"]; + content = { + type = "filesystem"; + format = "ext4"; + mountpoint = "/"; + }; + } + ]; + }; + }; + }; + }; +} diff --git a/hosts/rock5b/hardware-configuration.nix b/hosts/rock5b/hardware-configuration.nix deleted file mode 100644 index 670ddbc..0000000 --- a/hosts/rock5b/hardware-configuration.nix +++ /dev/null @@ -1,17 +0,0 @@ -{lib, ...}: { - fileSystems = { - "/" = { - device = "/dev/disk/by-label/NIXOS_ROOTFS"; - fsType = "ext4"; - }; - }; - - nixpkgs.hostPlatform = "aarch64-linux"; - - swapDevices = []; - - boot.loader = { - grub.enable = false; - generic-extlinux-compatible.enable = true; - }; -}