From f8ec2f5d8f24eaa72a19aa55434fba945e352d35 Mon Sep 17 00:00:00 2001 From: Christoph Hollizeck Date: Sat, 23 Nov 2024 14:39:56 +0100 Subject: [PATCH] fix build issues with the sd image --- flake.lock | 179 ++++++++++++++++++ flake.nix | 10 + .../aarch64-linux/cholli@nixberry/default.nix | 22 +++ homes/x86_64-linux/cholli@wsl/default.nix | 2 + modules/nixos/apps/cli-apps/helix/default.nix | 10 +- modules/nixos/tools/git/default.nix | 2 +- systems/aarch64-linux/nixberry/default.nix | 58 +++++- systems/x86_64-linux/yggdrasil/default.nix | 9 +- 8 files changed, 278 insertions(+), 14 deletions(-) create mode 100644 homes/aarch64-linux/cholli@nixberry/default.nix diff --git a/flake.lock b/flake.lock index 9d249af..8ca6c4f 100644 --- a/flake.lock +++ b/flake.lock @@ -741,6 +741,40 @@ "type": "github" } }, + "libcamera-src": { + "flake": false, + "locked": { + "lastModified": 1725630279, + "narHash": "sha256-KH30jmHfxXq4j2CL7kv18DYECJRp9ECuWNPnqPZajPA=", + "owner": "raspberrypi", + "repo": "libcamera", + "rev": "69a894c4adad524d3063dd027f5c4774485cf9db", + "type": "github" + }, + "original": { + "owner": "raspberrypi", + "repo": "libcamera", + "rev": "69a894c4adad524d3063dd027f5c4774485cf9db", + "type": "github" + } + }, + "libpisp-src": { + "flake": false, + "locked": { + "lastModified": 1724944683, + "narHash": "sha256-Fo2UJmQHS855YSSKKmGrsQnJzXog1cdpkIOO72yYAM4=", + "owner": "raspberrypi", + "repo": "libpisp", + "rev": "28196ed6edcfeda88d23cc5f213d51aa6fa17bb3", + "type": "github" + }, + "original": { + "owner": "raspberrypi", + "ref": "v1.0.7", + "repo": "libpisp", + "type": "github" + } + }, "nix-ld": { "inputs": { "nixpkgs": [ @@ -1026,6 +1060,35 @@ "type": "github" } }, + "raspberry-pi-nix": { + "inputs": { + "libcamera-src": "libcamera-src", + "libpisp-src": "libpisp-src", + "nixpkgs": [ + "nixpkgs" + ], + "rpi-bluez-firmware-src": "rpi-bluez-firmware-src", + "rpi-firmware-nonfree-src": "rpi-firmware-nonfree-src", + "rpi-firmware-src": "rpi-firmware-src", + "rpi-linux-6_10_12-src": "rpi-linux-6_10_12-src", + "rpi-linux-6_6_54-src": "rpi-linux-6_6_54-src", + "rpicam-apps-src": "rpicam-apps-src", + "u-boot-src": "u-boot-src" + }, + "locked": { + "lastModified": 1731941843, + "narHash": "sha256-/QG4C9WVP79A7jRFC3Ci1q1l6ah7gr3/SF/MWUk/hhM=", + "owner": "nix-community", + "repo": "raspberry-pi-nix", + "rev": "aaec735faf81ff05356d65c7408136d2c1522d34", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "raspberry-pi-nix", + "type": "github" + } + }, "root": { "inputs": { "fenix": "fenix", @@ -1045,12 +1108,115 @@ "nixpkgs-latest-factorio": "nixpkgs-latest-factorio", "nixpkgs-master": "nixpkgs-master", "nixpkgs-unstable": "nixpkgs-unstable", + "raspberry-pi-nix": "raspberry-pi-nix", "snowfall-flake": "snowfall-flake", "snowfall-lib": "snowfall-lib_2", "sops-nix": "sops-nix", "zen-browser": "zen-browser" } }, + "rpi-bluez-firmware-src": { + "flake": false, + "locked": { + "lastModified": 1708969706, + "narHash": "sha256-KakKnOBeWxh0exu44beZ7cbr5ni4RA9vkWYb9sGMb8Q=", + "owner": "RPi-Distro", + "repo": "bluez-firmware", + "rev": "78d6a07730e2d20c035899521ab67726dc028e1c", + "type": "github" + }, + "original": { + "owner": "RPi-Distro", + "ref": "bookworm", + "repo": "bluez-firmware", + "type": "github" + } + }, + "rpi-firmware-nonfree-src": { + "flake": false, + "locked": { + "lastModified": 1723266537, + "narHash": "sha256-T7eTKXqY9cxEMdab8Snda4CEOrEihy5uOhA6Fy+Mhnw=", + "owner": "RPi-Distro", + "repo": "firmware-nonfree", + "rev": "4b356e134e8333d073bd3802d767a825adec3807", + "type": "github" + }, + "original": { + "owner": "RPi-Distro", + "ref": "bookworm", + "repo": "firmware-nonfree", + "type": "github" + } + }, + "rpi-firmware-src": { + "flake": false, + "locked": { + "lastModified": 1727798811, + "narHash": "sha256-eavbshXGYmkYR33y9FLcQMJoAYdYTESVEy0g/RRXnb0=", + "owner": "raspberrypi", + "repo": "firmware", + "rev": "287e6a6c2d3b50eee3e2c5b2eacdd907e5cbe09a", + "type": "github" + }, + "original": { + "owner": "raspberrypi", + "ref": "1.20241001", + "repo": "firmware", + "type": "github" + } + }, + "rpi-linux-6_10_12-src": { + "flake": false, + "locked": { + "lastModified": 1728305462, + "narHash": "sha256-LtvNmGD1D5YYv+C9xxxddAeHw69o3OX/H9M7F663L74=", + "owner": "raspberrypi", + "repo": "linux", + "rev": "26ee50d56618c2d98100b1bc672fd201aed4d00f", + "type": "github" + }, + "original": { + "owner": "raspberrypi", + "ref": "rpi-6.10.y", + "repo": "linux", + "type": "github" + } + }, + "rpi-linux-6_6_54-src": { + "flake": false, + "locked": { + "lastModified": 1728155174, + "narHash": "sha256-/8RjW35XQMnshjAE4Ey8j3oWzE2GOntnBYY6PlvZGhs=", + "owner": "raspberrypi", + "repo": "linux", + "rev": "12f0f28db3afe451a81a34c5a444f6841c10067c", + "type": "github" + }, + "original": { + "owner": "raspberrypi", + "ref": "rpi-6.6.y", + "repo": "linux", + "type": "github" + } + }, + "rpicam-apps-src": { + "flake": false, + "locked": { + "lastModified": 1727515047, + "narHash": "sha256-qCYGrcibOeGztxf+sd44lD6VAOGoUNwRqZDdAmcTa/U=", + "owner": "raspberrypi", + "repo": "rpicam-apps", + "rev": "a8ccf9f3cd9df49875dfb834a2b490d41d226031", + "type": "github" + }, + "original": { + "owner": "raspberrypi", + "ref": "v1.5.2", + "repo": "rpicam-apps", + "type": "github" + } + }, "rust-analyzer-src": { "flake": false, "locked": { @@ -1280,6 +1446,19 @@ "type": "github" } }, + "u-boot-src": { + "flake": false, + "locked": { + "lastModified": 1719857238, + "narHash": "sha256-mJ2TBy0Y5ZtcGFgtU5RKr0UDUp5FWzojbFb+o/ebRJU=", + "type": "tarball", + "url": "https://ftp.denx.de/pub/u-boot/u-boot-2024.07.tar.bz2" + }, + "original": { + "type": "tarball", + "url": "https://ftp.denx.de/pub/u-boot/u-boot-2024.07.tar.bz2" + } + }, "xdph": { "inputs": { "hyprland-protocols": [ diff --git a/flake.nix b/flake.nix index 12a44aa..d9eb2d9 100644 --- a/flake.nix +++ b/flake.nix @@ -78,6 +78,11 @@ ## temporary zen-browser.url = "github:ch4og/zen-browser-flake"; + raspberry-pi-nix = { + url = "github:nix-community/raspberry-pi-nix"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + ################ ## inputs for dev shells @@ -124,6 +129,11 @@ sops-nix.nixosModules.sops ]; + systems.hosts.nixberry.modules = with inputs; [ + raspberry-pi-nix.nixosModules.raspberry-pi + raspberry-pi-nix.nixosModules.sd-image + ]; + systems.hosts.wsl.modules = with inputs; [ nixos-wsl.nixosModules.default ]; } // { diff --git a/homes/aarch64-linux/cholli@nixberry/default.nix b/homes/aarch64-linux/cholli@nixberry/default.nix new file mode 100644 index 0000000..5f2a75c --- /dev/null +++ b/homes/aarch64-linux/cholli@nixberry/default.nix @@ -0,0 +1,22 @@ +{ + lib, + pkgs, + config, + osConfig ? { }, + format ? "unknown", + ... +}: +with lib.wyrdgard; +{ + wyrdgard = { + apps = { + kitty = enabled; + }; + + tools = { + direnv = enabled; + }; + }; + + home.stateVersion = "24.11"; +} diff --git a/homes/x86_64-linux/cholli@wsl/default.nix b/homes/x86_64-linux/cholli@wsl/default.nix index 694b9c7..ea7dda6 100644 --- a/homes/x86_64-linux/cholli@wsl/default.nix +++ b/homes/x86_64-linux/cholli@wsl/default.nix @@ -17,4 +17,6 @@ with lib.wyrdgard; direnv = enabled; }; }; + + home.stateVersion = "24.05"; } diff --git a/modules/nixos/apps/cli-apps/helix/default.nix b/modules/nixos/apps/cli-apps/helix/default.nix index 53960a4..4589c39 100644 --- a/modules/nixos/apps/cli-apps/helix/default.nix +++ b/modules/nixos/apps/cli-apps/helix/default.nix @@ -8,7 +8,7 @@ ... }: let - inherit (lib) mkIf mkEnableOption; + inherit (lib) mkIf mkEnableOption mkOption; cfg = config.${namespace}.apps.cli-apps.helix; cachix-url = "https://helix.cachix.org"; @@ -19,13 +19,17 @@ in { options.${namespace}.apps.cli-apps.helix = { enable = mkEnableOption "Whether to enable helix or not"; + pkg = mkOption { + type = lib.types.package; + default = helix-pkg; + description = "Which helix pacakge to use"; + }; }; config = mkIf cfg.enable { environment = { systemPackages = [ - helix-pkg - pkgs.wl-clipboard + cfg.pkg ]; }; diff --git a/modules/nixos/tools/git/default.nix b/modules/nixos/tools/git/default.nix index aea0314..6fa5418 100644 --- a/modules/nixos/tools/git/default.nix +++ b/modules/nixos/tools/git/default.nix @@ -34,7 +34,7 @@ in lfs.enable = true; signing = { key = cfg.signingKey; - signByDefault = mkIf gpg.enable true; + signByDefault = true; }; extraConfig = { init = { diff --git a/systems/aarch64-linux/nixberry/default.nix b/systems/aarch64-linux/nixberry/default.nix index cf173cd..ec7345e 100644 --- a/systems/aarch64-linux/nixberry/default.nix +++ b/systems/aarch64-linux/nixberry/default.nix @@ -1,8 +1,7 @@ { lib, - modulesPath, - inputs, namespace, + pkgs, ... }: @@ -11,24 +10,65 @@ let inherit (lib) mkForce; in { - imports = with inputs.nixos-hardware.nixosModules; [ - (modulesPath + "/installer/scan/not-detected.nix") - (modulesPath + "/installer/sd-card/sd-image-aarch64.nix") - raspberry-pi-5 - ]; + # imports = with inputs.nixos-hardware.nixosModules; [ + # (modulesPath + "/installer/scan/not-detected.nix") + # raspberry-pi-5 + # ]; + + raspberry-pi-nix.board = "bcm2712"; + + hardware = { + raspberry-pi = { + config = { + all = { + base-dt-params = { + BOOT_UART = { + value = 1; + enable = true; + }; + uart_2ndstage = { + value = 1; + enable = true; + }; + }; + dt-overlays = { + disable-bt = { + enable = true; + params = { }; + }; + }; + }; + }; + }; + }; + + services.openssh = { + enable = true; + settings = { + PasswordAuthentication = false; + KbdInteractiveAuthentication = false; + }; + }; ${namespace} = { - submodules = { basics = enabled; }; + apps.cli-apps.helix = { + pkg = pkgs.helix; + }; + system = { boot = { # Raspberry Pi requires a specific bootloader. enable = mkForce false; }; }; + + user.trustedPublicKeys = [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHFrDiO5+vMfD5MimkzN32iw3MnSMLZ0mHvOrHVVmLD0" + ]; }; # This value determines the NixOS release from which the default @@ -37,5 +77,5 @@ in # this value at the release version of the first install of this system. # Before changing this value read the documentation for this option # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). - system.stateVersion = "24.05"; # Did you read the comment? + system.stateVersion = "24.11"; # Did you read the comment? } diff --git a/systems/x86_64-linux/yggdrasil/default.nix b/systems/x86_64-linux/yggdrasil/default.nix index 533b826..7df70a0 100644 --- a/systems/x86_64-linux/yggdrasil/default.nix +++ b/systems/x86_64-linux/yggdrasil/default.nix @@ -49,8 +49,15 @@ in ]; distributedBuilds = true; - + settings = { + trusted-users = [ + "@wheel" + "remotebuild" + ]; + trusted-public-keys = [ "nixberry:25s8/rxsolAXg4skjnecCeqcfkxYE9FGCPG5UcXsFlw=" ]; + }; }; + ${namespace} = { archetypes = { gaming.enable = true;