From b93c1ad6aa6d3ade61c96e0e9a6a3f785fda18dd Mon Sep 17 00:00:00 2001 From: Doloro1978 Date: Mon, 25 May 2026 23:34:30 +0100 Subject: [PATCH] meow --- config/hosts/aspects/servers/rpi5.nix | 1 + config/modules/raspberry-pi.nix | 46 ++++++-- config/modules/rpi-cache.nix | 10 ++ flake.lock | 148 +++++++++++++++++++++----- flake.nix | 1 + 5 files changed, 170 insertions(+), 36 deletions(-) create mode 100644 config/modules/rpi-cache.nix diff --git a/config/hosts/aspects/servers/rpi5.nix b/config/hosts/aspects/servers/rpi5.nix index b2b4fea..5fd69d7 100644 --- a/config/hosts/aspects/servers/rpi5.nix +++ b/config/hosts/aspects/servers/rpi5.nix @@ -7,6 +7,7 @@ den.aspects.rpi5 = { includes = [ + modules.rpi-cache # diff --git a/config/modules/raspberry-pi.nix b/config/modules/raspberry-pi.nix index 9f4cd7b..e4ab982 100644 --- a/config/modules/raspberry-pi.nix +++ b/config/modules/raspberry-pi.nix @@ -7,32 +7,58 @@ }: { flake-file.inputs = { raspberry-pi-nix.url = "github:cmyk/raspberry-pi-nix"; + nixos-raspberrypi.url = "github:nvmd/nixos-raspberrypi/main"; nixos-hardware.url = "github:NixOS/nixos-hardware/master"; }; modules.raspberry-pi = { provides = { "5" = { - nixos = { - pkgs, - modulesPath, - ... - }: { + nixos = {pkgs, ...}: { imports = [ - inputs.nixos-hardware.nixosModules.raspberry-pi-5 - "${modulesPath}/installer/sd-card/sd-image-aarch64.nix" + # inputs.nixos-hardware.nixosModules.raspberry-pi-5 + inputs.nixos-raspberrypi.lib.inject-overlays-global + inputs.nixos-raspberrypi.nixosModules.trusted-nix-caches + inputs.nixos-raspberrypi.lib.inject-overlays + + inputs.nixos-raspberrypi.nixosModules.raspberry-pi-5.base + inputs.nixos-raspberrypi.nixosModules.raspberry-pi-5.page-size-16k + inputs.nixos-raspberrypi.nixosModules.raspberry-pi-5.display-vc4 + inputs.nixos-raspberrypi.nixosModules.raspberry-pi-5.bluetooth + + inputs.nixos-raspberrypi.nixosModules.sd-image ]; environment.systemPackages = with pkgs; [ libraspberrypi ]; + _module.args = {inherit (inputs) nixos-raspberrypi;}; + sdImage.compressImage = false; - boot.initrd.systemd.tpm2.enable = false; - boot.initrd.allowMissingModules = true; - boot.zfs.forceImportRoot = false; + boot.loader.raspberry-pi.bootloader = "kernel"; + # boot.initrd.systemd.tpm2.enable = false; + # boot.initrd.allowMissingModules = true; + boot.supportedFilesystems.zfs = false; # hardware.enableRedistributableFirmware = true; + # fileSystems = { + # "/boot/firmware" = { + # device = "/dev/disk/by-uuid/2175-794E"; + # fsType = "vfat"; + # options = [ + # "noatime" + # "noauto" + # "x-systemd.automount" + # "x-systemd.idle-timeout=1min" + # ]; + # }; + # "/" = { + # device = "/dev/disk/by-uuid/44444444-4444-4444-8888-888888888888"; + # fsType = "ext4"; + # options = ["noatime"]; + # }; + # }; }; }; }; diff --git a/config/modules/rpi-cache.nix b/config/modules/rpi-cache.nix new file mode 100644 index 0000000..0e9b29d --- /dev/null +++ b/config/modules/rpi-cache.nix @@ -0,0 +1,10 @@ +{ inputs, ... }: { + modules.rpi-cache = { + nixos = { + nix.settings = { + substituters = inputs.nixos-raspberrypi.nixConfig."extra-substituters"; + trusted-public-keys = inputs.nixos-raspberrypi.nixConfig."extra-trusted-public-keys"; + }; + }; + }; +} diff --git a/flake.lock b/flake.lock index 7a32950..ad0be0f 100644 --- a/flake.lock +++ b/flake.lock @@ -33,6 +33,22 @@ "type": "github" } }, + "argononed": { + "flake": false, + "locked": { + "lastModified": 1729566243, + "narHash": "sha256-DPNI0Dpk5aym3Baf5UbEe5GENDrSmmXVdriRSWE+rgk=", + "owner": "nvmd", + "repo": "argononed", + "rev": "16dbee54d49b66d5654d228d1061246b440ef7cf", + "type": "github" + }, + "original": { + "owner": "nvmd", + "repo": "argononed", + "type": "github" + } + }, "base16": { "inputs": { "fromYaml": "fromYaml" @@ -216,6 +232,21 @@ } }, "flake-compat_3": { + "locked": { + "lastModified": 1767039857, + "narHash": "sha256-vNpUSpF5Nuw8xvDLj2KCwwksIbjua2LZCqhV1LNRDns=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "5edf11c44bc78a0d334f6334cdaf7d60d732daab", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-compat_4": { "flake": false, "locked": { "lastModified": 1767039857, @@ -944,10 +975,58 @@ "type": "github" } }, + "nixos-images": { + "inputs": { + "nixos-stable": [ + "nixos-raspberrypi", + "nixpkgs" + ], + "nixos-unstable": [ + "nixos-raspberrypi", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1747747741, + "narHash": "sha256-LUOH27unNWbGTvZFitHonraNx0JF/55h30r9WxqrznM=", + "owner": "nvmd", + "repo": "nixos-images", + "rev": "cbbd6db325775096680b65e2a32fb6187c09bbb4", + "type": "github" + }, + "original": { + "owner": "nvmd", + "ref": "sdimage-installer", + "repo": "nixos-images", + "type": "github" + } + }, + "nixos-raspberrypi": { + "inputs": { + "argononed": "argononed", + "flake-compat": "flake-compat_3", + "nixos-images": "nixos-images", + "nixpkgs": "nixpkgs_5" + }, + "locked": { + "lastModified": 1779023229, + "narHash": "sha256-MInilg7B/06c34SwOuGSBho4l0H1EZcmvxTkSWCs5pE=", + "owner": "nvmd", + "repo": "nixos-raspberrypi", + "rev": "06c6e3513e1ee64b651913193fc6ac38aa4963f5", + "type": "github" + }, + "original": { + "owner": "nvmd", + "ref": "main", + "repo": "nixos-raspberrypi", + "type": "github" + } + }, "nixos-wsl": { "inputs": { - "flake-compat": "flake-compat_3", - "nixpkgs": "nixpkgs_5" + "flake-compat": "flake-compat_4", + "nixpkgs": "nixpkgs_6" }, "locked": { "lastModified": 1777732699, @@ -1011,6 +1090,22 @@ } }, "nixpkgs_10": { + "locked": { + "lastModified": 1745279238, + "narHash": "sha256-AQ7M9wTa/Pa/kK5pcGTgX/DGqMHyzsyINfN7ktsI7Fo=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "9684b53175fc6c09581e94cc85f05ab77464c7e3", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-24.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_11": { "locked": { "lastModified": 1778869304, "narHash": "sha256-VdRy3A14M5vIE882DJcaaR+5wrss9Qsg4YNVbr7uj3k=", @@ -1069,6 +1164,22 @@ } }, "nixpkgs_5": { + "locked": { + "lastModified": 1778737229, + "narHash": "sha256-6xWoytx8jFW4PF1GjRm/i/53trbpKGfz6zjzQGBr4cI=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "d7a713c0b7e47c908258e71cba7a2d77cc8d71d5", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-25.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_6": { "locked": { "lastModified": 1776169885, "narHash": "sha256-l/iNYDZ4bGOAFQY2q8y5OAfBBtrDAaPuRQqWaFHVRXM=", @@ -1084,7 +1195,7 @@ "type": "github" } }, - "nixpkgs_6": { + "nixpkgs_7": { "locked": { "lastModified": 1778869304, "narHash": "sha256-vZOcDniDPc1cS8A4Xi5YE6AGyPIvEpy4GMyayA3SWIM=", @@ -1097,7 +1208,7 @@ "url": "https://channels.nixos.org/nixpkgs-unstable/nixexprs.tar.xz" } }, - "nixpkgs_7": { + "nixpkgs_8": { "locked": { "lastModified": 1778869304, "narHash": "sha256-30sZNZoA1cqF5JNO9fVX+wgiQYjB7HJqqJ4ztCDeBZE=", @@ -1113,7 +1224,7 @@ "type": "github" } }, - "nixpkgs_8": { + "nixpkgs_9": { "locked": { "lastModified": 1774709303, "narHash": "sha256-D3Q07BbIA2KnTcSXIqqu9P586uWxN74zNoCH3h2ESHg=", @@ -1129,26 +1240,10 @@ "type": "github" } }, - "nixpkgs_9": { - "locked": { - "lastModified": 1745279238, - "narHash": "sha256-AQ7M9wTa/Pa/kK5pcGTgX/DGqMHyzsyINfN7ktsI7Fo=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "9684b53175fc6c09581e94cc85f05ab77464c7e3", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixos-24.11", - "repo": "nixpkgs", - "type": "github" - } - }, "nixvim": { "inputs": { "flake-parts": "flake-parts_3", - "nixpkgs": "nixpkgs_7", + "nixpkgs": "nixpkgs_8", "systems": "systems_4" }, "locked": { @@ -1192,7 +1287,7 @@ }, "omp-nix": { "inputs": { - "nixpkgs": "nixpkgs_8" + "nixpkgs": "nixpkgs_9" }, "locked": { "lastModified": 1779271700, @@ -1236,7 +1331,7 @@ "inputs": { "libcamera-src": "libcamera-src", "libpisp-src": "libpisp-src", - "nixpkgs": "nixpkgs_9", + "nixpkgs": "nixpkgs_10", "rpi-bluez-firmware-src": "rpi-bluez-firmware-src", "rpi-firmware-nonfree-src": "rpi-firmware-nonfree-src", "rpi-firmware-src": "rpi-firmware-src", @@ -1272,8 +1367,9 @@ "niri-flake": "niri-flake", "nix-cachyos-kernel": "nix-cachyos-kernel", "nixos-hardware": "nixos-hardware", + "nixos-raspberrypi": "nixos-raspberrypi", "nixos-wsl": "nixos-wsl", - "nixpkgs": "nixpkgs_6", + "nixpkgs": "nixpkgs_7", "nixvim": "nixvim", "omp-nix": "omp-nix", "raspberry-pi-nix": "raspberry-pi-nix", @@ -1391,7 +1487,7 @@ }, "spicetify-nix": { "inputs": { - "nixpkgs": "nixpkgs_10", + "nixpkgs": "nixpkgs_11", "systems": "systems_5" }, "locked": { diff --git a/flake.nix b/flake.nix index dba5e3b..330da5b 100644 --- a/flake.nix +++ b/flake.nix @@ -31,6 +31,7 @@ }; nix-cachyos-kernel.url = "github:xddxdd/nix-cachyos-kernel/release"; nixos-hardware.url = "github:NixOS/nixos-hardware/master"; + nixos-raspberrypi.url = "github:nvmd/nixos-raspberrypi/main"; nixos-wsl.url = "github:nix-community/NixOS-WSL"; nixpkgs.url = "https://channels.nixos.org/nixpkgs-unstable/nixexprs.tar.xz"; nixvim.url = "github:nix-community/nixvim";