diff --git a/hardwares/rpi-5/disks.nix b/hardwares/rpi-5/disks.nix index 685ab75..7a037d9 100644 --- a/hardwares/rpi-5/disks.nix +++ b/hardwares/rpi-5/disks.nix @@ -1,10 +1,10 @@ -{ inputs, ... }: +{ inputs, lib, ... }: { imports = [ inputs.disko.nixosModules.disko ]; disko.devices = { disk = { main = { - device = "/dev/mmcblk0"; + device = "/dev/disk/by-label/NIXOS_SD"; type = "disk"; content = { type = "gpt"; @@ -36,24 +36,9 @@ root = { size = "100%"; content = { - type = "btrfs"; - extraArgs = [ "-f" ]; # Override existing partition - # Subvolumes must set a mountpoint in order to be mounted, - # unless their parent is mounted - subvolumes = { - # Subvolume name is different from mountpoint - "@" = { - mountpoint = "/"; - }; - # Subvolume name is the same as the mountpoint - "@home" = { - mountpoint = "/home"; - }; - # Parent is not mounted so the mountpoint must be set - "@nix" = { - mountpoint = "/nix"; - }; - }; + type = "filesystem"; + format = "ext4"; + mountpoint = "/"; }; }; }; diff --git a/hardwares/rpi-5/nixos.nix b/hardwares/rpi-5/nixos.nix index bbf323f..f98eeae 100644 --- a/hardwares/rpi-5/nixos.nix +++ b/hardwares/rpi-5/nixos.nix @@ -1,7 +1,36 @@ -{ lib, inputs, ... }: +{ + lib, + inputs, + modulesPath, + ... +}: { imports = [ - ./disks.nix + # ./disks.nix inputs.nixos-hardware.nixosModules.raspberry-pi-4 + (modulesPath + "/installer/sd-card/sd-image-aarch64.nix") + ]; + fileSystems = { + "/" = { + device = "/dev/disk/by-label/NIXOS_SD"; + fsType = "ext4"; + options = [ "noatime" ]; + }; + }; + boot.supportedFilesystems = lib.mkForce [ + "btrfs" + "reiserfs" + "vfat" + "ext4" + "f2fs" + "xfs" + "ntfs" + "cifs" + ]; + nixpkgs.overlays = [ + # https://github.com/NixOS/nixpkgs/issues/126755#issuecomment-869149243 + (final: super: { + makeModulesClosure = x: super.makeModulesClosure (x // { allowMissing = true; }); + }) ]; } diff --git a/hosts/doloro-laptop/nixos.nix b/hosts/doloro-laptop/nixos.nix index cacbe4c..6cc44e4 100644 --- a/hosts/doloro-laptop/nixos.nix +++ b/hosts/doloro-laptop/nixos.nix @@ -120,6 +120,7 @@ in services.libinput.enable = true; + boot.binfmt.emulatedSystems = [ "aarch64-linux" ]; # Define a user account. Don't forget to set a password with ‘passwd’. users.users.doloro = { isNormalUser = true; @@ -135,6 +136,7 @@ in # initialPassword = "sex"; }; users.mutableUsers = false; + services.system76-scheduler.enable = true; # programs.firefox.enable = true; diff --git a/hosts/rpi-5/nixos.nix b/hosts/rpi-5/nixos.nix index bbf323f..586e8a9 100644 --- a/hosts/rpi-5/nixos.nix +++ b/hosts/rpi-5/nixos.nix @@ -1,7 +1,40 @@ -{ lib, inputs, ... }: { - imports = [ - ./disks.nix - inputs.nixos-hardware.nixosModules.raspberry-pi-4 - ]; + lib, + pkgs, + inputs, + ... +}: +{ + users = { + mutableUsers = false; + users.doloro = { + isNormalUser = true; + extraGroups = [ "wheel" ]; + openssh.authorizedKeys.keys = [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIE/4h+WCBBW82puv8SMdUbkWymF4amEMuZitgFztB6oZ" # laptop pub key + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBaa6Z5qtBSLEz+A4fQGYPfkOISsRQlmKkVbcx2zxML7" # pc pub key + ]; + }; + }; + + networking.hostName = "nixos-001-rp5"; + + services.openssh.enable = true; + + boot = { + kernelPackages = pkgs.linuxKernel.packages.linux_rpi4; + initrd.availableKernelModules = [ + "xhci_pci" + "usbhid" + "usb_storage" + ]; + loader = { + grub.enable = false; + generic-extlinux-compatible.enable = true; + }; + }; + + hardware.enableRedistributableFirmware = true; + system.stateVersion = "25.11"; + nixpkgs.hostPlatform = "aarch64-linux"; }