mirror of
https://github.com/nix-community/raspberry-pi-nix.git
synced 2025-11-08 19:46:03 +01:00
feat: bump all software & kernel, fix libcamera issues, load versions dynamically, 6.14 support
This commit is contained in:
parent
3e8100d5e9
commit
c635f54fbd
7 changed files with 180 additions and 153 deletions
138
flake.lock
generated
138
flake.lock
generated
|
|
@ -3,44 +3,44 @@
|
|||
"libcamera-src": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1725630279,
|
||||
"narHash": "sha256-KH30jmHfxXq4j2CL7kv18DYECJRp9ECuWNPnqPZajPA=",
|
||||
"lastModified": 1739434802,
|
||||
"narHash": "sha256-89uo3ajxozSpM4AGVIVb5GJ70giAQeyw0duIj5PRBgo=",
|
||||
"owner": "raspberrypi",
|
||||
"repo": "libcamera",
|
||||
"rev": "69a894c4adad524d3063dd027f5c4774485cf9db",
|
||||
"rev": "29156679717bec7cc4784aeba3548807f2c27fca",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "raspberrypi",
|
||||
"ref": "v0.4.0+rpt20250213",
|
||||
"repo": "libcamera",
|
||||
"rev": "69a894c4adad524d3063dd027f5c4774485cf9db",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"libpisp-src": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1724944683,
|
||||
"narHash": "sha256-Fo2UJmQHS855YSSKKmGrsQnJzXog1cdpkIOO72yYAM4=",
|
||||
"lastModified": 1740558818,
|
||||
"narHash": "sha256-D2wkC6VR9MSuHfoaIo3UhgqFW2HxCo0In09gnu1yG/E=",
|
||||
"owner": "raspberrypi",
|
||||
"repo": "libpisp",
|
||||
"rev": "28196ed6edcfeda88d23cc5f213d51aa6fa17bb3",
|
||||
"rev": "b16ebf888b5f525506d13417e6cd8808015653f6",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "raspberrypi",
|
||||
"ref": "v1.0.7",
|
||||
"ref": "v1.2.0",
|
||||
"repo": "libpisp",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1736061677,
|
||||
"narHash": "sha256-DjkQPnkAfd7eB522PwnkGhOMuT9QVCZspDpJJYyOj60=",
|
||||
"lastModified": 1741332913,
|
||||
"narHash": "sha256-ri1e8ZliWS3Jnp9yqpKApHaOo7KBN33W8ECAKA4teAQ=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "cbd8ec4de4469333c82ff40d057350c30e9f7d36",
|
||||
"rev": "20755fa05115c84be00b04690630cb38f0a203ad",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
@ -56,22 +56,22 @@
|
|||
"libpisp-src": "libpisp-src",
|
||||
"nixpkgs": "nixpkgs",
|
||||
"rpi-bluez-firmware-src": "rpi-bluez-firmware-src",
|
||||
"rpi-firmware-6_14_y-src": "rpi-firmware-6_14_y-src",
|
||||
"rpi-firmware-6_6_y-src": "rpi-firmware-6_6_y-src",
|
||||
"rpi-firmware-nonfree-src": "rpi-firmware-nonfree-src",
|
||||
"rpi-firmware-src": "rpi-firmware-src",
|
||||
"rpi-linux-6_12_17-src": "rpi-linux-6_12_17-src",
|
||||
"rpi-linux-6_6_78-src": "rpi-linux-6_6_78-src",
|
||||
"rpi-linux-stable-src": "rpi-linux-stable-src",
|
||||
"rpi-linux-6_14_y-src": "rpi-linux-6_14_y-src",
|
||||
"rpi-linux-6_6_y-src": "rpi-linux-6_6_y-src",
|
||||
"rpicam-apps-src": "rpicam-apps-src"
|
||||
}
|
||||
},
|
||||
"rpi-bluez-firmware-src": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1708969706,
|
||||
"narHash": "sha256-KakKnOBeWxh0exu44beZ7cbr5ni4RA9vkWYb9sGMb8Q=",
|
||||
"lastModified": 1741017538,
|
||||
"narHash": "sha256-t+D4VUfEIov83KV4wiKp6TqXTHXGkxg/mANi4GW7QHs=",
|
||||
"owner": "RPi-Distro",
|
||||
"repo": "bluez-firmware",
|
||||
"rev": "78d6a07730e2d20c035899521ab67726dc028e1c",
|
||||
"rev": "2bbfb8438e824f5f61dae3f6ebb367a6129a4d63",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
@ -81,14 +81,48 @@
|
|||
"type": "github"
|
||||
}
|
||||
},
|
||||
"rpi-firmware-6_14_y-src": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1739975675,
|
||||
"narHash": "sha256-DklG7vO4BNK660P9Rd+f8oNavojgGcldB8d2+PPhGvk=",
|
||||
"owner": "raspberrypi",
|
||||
"repo": "firmware",
|
||||
"rev": "03a4fb56ccf125623f4f90333345e393be60b7bf",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "raspberrypi",
|
||||
"ref": "next",
|
||||
"repo": "firmware",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"rpi-firmware-6_6_y-src": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1741190071,
|
||||
"narHash": "sha256-J2Na7yGKvRDWKC+1gFEQMuaam+4vt+RsV9FjarDgvMs=",
|
||||
"owner": "raspberrypi",
|
||||
"repo": "firmware",
|
||||
"rev": "f9ff9c8f22a148a555a2c090af9649ad84709dc4",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "raspberrypi",
|
||||
"ref": "stable",
|
||||
"repo": "firmware",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"rpi-firmware-nonfree-src": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1723266537,
|
||||
"narHash": "sha256-T7eTKXqY9cxEMdab8Snda4CEOrEihy5uOhA6Fy+Mhnw=",
|
||||
"lastModified": 1741367244,
|
||||
"narHash": "sha256-D1ba93e2xsOFcdTV9FXjKU1NKKBSu5ekmGwCtxdiJ8c=",
|
||||
"owner": "RPi-Distro",
|
||||
"repo": "firmware-nonfree",
|
||||
"rev": "4b356e134e8333d073bd3802d767a825adec3807",
|
||||
"rev": "69377e5ff9530fc27bcd5bd63198843e06491312",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
@ -98,48 +132,31 @@
|
|||
"type": "github"
|
||||
}
|
||||
},
|
||||
"rpi-firmware-src": {
|
||||
"rpi-linux-6_14_y-src": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1728405098,
|
||||
"narHash": "sha256-4gnK0KbqFnjBmWia9Jt2gveVWftmHrprpwBqYVqE/k0=",
|
||||
"lastModified": 1741347313,
|
||||
"narHash": "sha256-f0C0sh2eKkdkD5iD05AjurpFeYiwpt3Ne2a+Jx/eJH4=",
|
||||
"owner": "raspberrypi",
|
||||
"repo": "firmware",
|
||||
"rev": "7bbb5f80d20a2335066a8781459c9f33e5eebc64",
|
||||
"repo": "linux",
|
||||
"rev": "190bc163f8d6660e17f4994ed9c6c3a87c9fc4d3",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "raspberrypi",
|
||||
"ref": "1.20241008",
|
||||
"repo": "firmware",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"rpi-linux-6_12_17-src": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1740765145,
|
||||
"narHash": "sha256-hoCsGc4+RC/2LmxDtswLBL5ZhWlw4vSiL4Vkl39r2MU=",
|
||||
"owner": "raspberrypi",
|
||||
"repo": "linux",
|
||||
"rev": "5985ce32e511f4e8279a841a1b06a8c7d972b386",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "raspberrypi",
|
||||
"ref": "rpi-6.12.y",
|
||||
"ref": "rpi-6.14.y",
|
||||
"repo": "linux",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"rpi-linux-6_6_78-src": {
|
||||
"rpi-linux-6_6_y-src": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1740503700,
|
||||
"narHash": "sha256-Y8+ot4Yi3UKwlZK3ap15rZZ16VZDvmeFkD46+6Ku7bE=",
|
||||
"lastModified": 1741365749,
|
||||
"narHash": "sha256-7IzfI4Do2P0rlQ51URMkEyMBu4mlUCxZJGbqg4bIL70=",
|
||||
"owner": "raspberrypi",
|
||||
"repo": "linux",
|
||||
"rev": "2e071057fded90e789c0101498e45a1778be93fe",
|
||||
"rev": "3c21211667e35029054b0dfebdf292e4e7d5754b",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
@ -149,36 +166,19 @@
|
|||
"type": "github"
|
||||
}
|
||||
},
|
||||
"rpi-linux-stable-src": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1728403745,
|
||||
"narHash": "sha256-phCxkuO+jUGZkfzSrBq6yErQeO2Td+inIGHxctXbD5U=",
|
||||
"owner": "raspberrypi",
|
||||
"repo": "linux",
|
||||
"rev": "5aeecea9f4a45248bcf564dec924965e066a7bfd",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "raspberrypi",
|
||||
"ref": "stable_20241008",
|
||||
"repo": "linux",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"rpicam-apps-src": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1727515047,
|
||||
"narHash": "sha256-qCYGrcibOeGztxf+sd44lD6VAOGoUNwRqZDdAmcTa/U=",
|
||||
"lastModified": 1737988296,
|
||||
"narHash": "sha256-pTSHmRmGV203HjrH6MWNDEz2xLitCsILKsOYD9PgjwU=",
|
||||
"owner": "raspberrypi",
|
||||
"repo": "rpicam-apps",
|
||||
"rev": "a8ccf9f3cd9df49875dfb834a2b490d41d226031",
|
||||
"rev": "025ca84648c9b9d74711477bf94b05bec349f53d",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "raspberrypi",
|
||||
"ref": "v1.5.2",
|
||||
"ref": "v1.6.0",
|
||||
"repo": "rpicam-apps",
|
||||
"type": "github"
|
||||
}
|
||||
|
|
|
|||
34
flake.nix
34
flake.nix
|
|
@ -3,21 +3,21 @@
|
|||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11";
|
||||
rpi-linux-stable-src = {
|
||||
flake = false;
|
||||
url = "github:raspberrypi/linux/stable_20241008";
|
||||
};
|
||||
rpi-linux-6_6_78-src = {
|
||||
rpi-linux-6_6_y-src = {
|
||||
flake = false;
|
||||
url = "github:raspberrypi/linux/rpi-6.6.y";
|
||||
};
|
||||
rpi-linux-6_12_17-src = {
|
||||
rpi-linux-6_14_y-src = {
|
||||
flake = false;
|
||||
url = "github:raspberrypi/linux/rpi-6.12.y";
|
||||
url = "github:raspberrypi/linux/rpi-6.14.y";
|
||||
};
|
||||
rpi-firmware-src = {
|
||||
rpi-firmware-6_6_y-src = {
|
||||
flake = false;
|
||||
url = "github:raspberrypi/firmware/1.20241008";
|
||||
url = "github:raspberrypi/firmware/stable";
|
||||
};
|
||||
rpi-firmware-6_14_y-src = {
|
||||
flake = false;
|
||||
url = "github:raspberrypi/firmware/next";
|
||||
};
|
||||
rpi-firmware-nonfree-src = {
|
||||
flake = false;
|
||||
|
|
@ -29,15 +29,15 @@
|
|||
};
|
||||
rpicam-apps-src = {
|
||||
flake = false;
|
||||
url = "github:raspberrypi/rpicam-apps/v1.5.2";
|
||||
url = "github:raspberrypi/rpicam-apps/v1.6.0";
|
||||
};
|
||||
libcamera-src = {
|
||||
flake = false;
|
||||
url = "github:raspberrypi/libcamera/69a894c4adad524d3063dd027f5c4774485cf9db"; # v0.3.1+rpt20240906
|
||||
url = "github:raspberrypi/libcamera/v0.4.0+rpt20250213";
|
||||
};
|
||||
libpisp-src = {
|
||||
flake = false;
|
||||
url = "github:raspberrypi/libpisp/v1.0.7";
|
||||
url = "github:raspberrypi/libpisp/v1.2.0";
|
||||
};
|
||||
};
|
||||
|
||||
|
|
@ -47,15 +47,18 @@
|
|||
system = "aarch64-linux";
|
||||
overlays = with self.overlays; [ core libcamera ];
|
||||
};
|
||||
lock = builtins.fromJSON (builtins.readFile ./flake.lock);
|
||||
lib = srcs.nixpkgs.lib;
|
||||
inputs = lib.recursiveUpdate (builtins.removeAttrs srcs [ "self" ]) { inherit lock; };
|
||||
in
|
||||
{
|
||||
overlays = {
|
||||
core = import ./overlays (builtins.removeAttrs srcs [ "self" ]);
|
||||
libcamera = import ./overlays/libcamera.nix (builtins.removeAttrs srcs [ "self" ]);
|
||||
core = import ./overlays inputs;
|
||||
libcamera = import ./overlays/libcamera.nix inputs;
|
||||
};
|
||||
nixosModules = {
|
||||
raspberry-pi = import ./rpi {
|
||||
inherit pinned;
|
||||
inherit pinned inputs;
|
||||
core-overlay = self.overlays.core;
|
||||
libcamera-overlay = self.overlays.libcamera;
|
||||
};
|
||||
|
|
@ -82,7 +85,6 @@
|
|||
in
|
||||
{
|
||||
example-sd-image = self.nixosConfigurations.rpi-example.config.system.build.sdImage;
|
||||
firmware = pinned.raspberrypifw;
|
||||
libcamera = pinned.libcamera;
|
||||
wireless-firmware = pinned.raspberrypiWirelessFirmware;
|
||||
uboot-rpi-arm64 = pinned.uboot-rpi-arm64;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
{ rpi-linux-stable-src
|
||||
, rpi-linux-6_6_78-src
|
||||
, rpi-linux-6_12_17-src
|
||||
, rpi-firmware-src
|
||||
{ lock
|
||||
, rpi-linux-6_6_y-src
|
||||
, rpi-linux-6_14_y-src
|
||||
, rpi-firmware-6_6_y-src
|
||||
, rpi-firmware-6_14_y-src
|
||||
, rpi-firmware-nonfree-src
|
||||
, rpi-bluez-firmware-src
|
||||
, ...
|
||||
|
|
@ -9,20 +10,15 @@
|
|||
final: prev:
|
||||
let
|
||||
versions = {
|
||||
v6_6_51.src = rpi-linux-stable-src;
|
||||
v6_6_78.src = rpi-linux-6_6_78-src;
|
||||
v6_12_17 = {
|
||||
src = rpi-linux-6_12_17-src;
|
||||
patches = [
|
||||
{
|
||||
name = "remove-readme-target.patch";
|
||||
patch = final.fetchpatch {
|
||||
url = "https://github.com/raspberrypi/linux/commit/3c0fd51d184f1748b83d28e1113265425c19bcb5.patch";
|
||||
hash = "sha256-v7uZOmPCUp2i7NGVgjqnQYe6dEBD+aATuP/oRs9jfuk=";
|
||||
};
|
||||
}
|
||||
];
|
||||
v6_6_78 = {
|
||||
src = rpi-linux-6_6_y-src;
|
||||
firmware = rpi-firmware-6_6_y-src;
|
||||
};
|
||||
v6_14_0-rc7 = {
|
||||
src = rpi-linux-6_14_y-src;
|
||||
firmware = rpi-firmware-6_14_y-src;
|
||||
};
|
||||
|
||||
};
|
||||
boards = [ "bcm2711" "bcm2712" ];
|
||||
|
||||
|
|
@ -33,44 +29,48 @@ let
|
|||
version-slug = builtins.replaceStrings [ "v" "_" ] [ "" "." ] version;
|
||||
in
|
||||
{
|
||||
"${version}"."${board}" = (final.buildLinux {
|
||||
modDirVersion = version-slug;
|
||||
version = version-slug;
|
||||
pname = "linux-rpi";
|
||||
src = kernel.src;
|
||||
defconfig = "${board}_defconfig";
|
||||
structuredExtraConfig = with final.lib.kernel; {
|
||||
# The perl script to generate kernel options sets unspecified
|
||||
# parameters to `m` if possible [1]. This results in the
|
||||
# unspecified config option KUNIT [2] getting set to `m` which
|
||||
# causes DRM_VC4_KUNIT_TEST [3] to get set to `y`.
|
||||
#
|
||||
# This vc4 unit test fails on boot due to a null pointer
|
||||
# exception with the existing config. I'm not sure why, but in
|
||||
# any case, the DRM_VC4_KUNIT_TEST config option itself states
|
||||
# that it is only useful for kernel developers working on the
|
||||
# vc4 driver. So, I feel no need to deviate from the standard
|
||||
# rpi kernel and attempt to successfully enable this test and
|
||||
# other unit tests because the nixos perl script has this
|
||||
# sloppy "default to m" behavior. So, I set KUNIT to `n`.
|
||||
#
|
||||
# [1] https://github.com/NixOS/nixpkgs/blob/85bcb95aa83be667e562e781e9d186c57a07d757/pkgs/os-specific/linux/kernel/generate-config.pl#L1-L10
|
||||
# [2] https://github.com/raspberrypi/linux/blob/1.20230405/lib/kunit/Kconfig#L5-L14
|
||||
# [3] https://github.com/raspberrypi/linux/blob/bb63dc31e48948bc2649357758c7a152210109c4/drivers/gpu/drm/vc4/Kconfig#L38-L52
|
||||
KUNIT = no;
|
||||
};
|
||||
features.efiBootStub = false;
|
||||
kernelPatches =
|
||||
if kernel ? "patches" then kernel.patches else [ ];
|
||||
ignoreConfigErrors = true;
|
||||
}).overrideAttrs
|
||||
(oldAttrs: {
|
||||
postConfigure = ''
|
||||
# The v7 defconfig has this set to '-v7' which screws up our modDirVersion.
|
||||
sed -i $buildRoot/.config -e 's/^CONFIG_LOCALVERSION=.*/CONFIG_LOCALVERSION=""/'
|
||||
sed -i $buildRoot/include/config/auto.conf -e 's/^CONFIG_LOCALVERSION=.*/CONFIG_LOCALVERSION=""/'
|
||||
'';
|
||||
});
|
||||
"${version}"."${board}" = {
|
||||
kernel = (final.buildLinux {
|
||||
modDirVersion = version-slug;
|
||||
version = version-slug;
|
||||
pname = "linux-rpi";
|
||||
src = kernel.src;
|
||||
defconfig = "${board}_defconfig";
|
||||
structuredExtraConfig = with final.lib.kernel; {
|
||||
# The perl script to generate kernel options sets unspecified
|
||||
# parameters to `m` if possible [1]. This results in the
|
||||
# unspecified config option KUNIT [2] getting set to `m` which
|
||||
# causes DRM_VC4_KUNIT_TEST [3] to get set to `y`.
|
||||
#
|
||||
# This vc4 unit test fails on boot due to a null pointer
|
||||
# exception with the existing config. I'm not sure why, but in
|
||||
# any case, the DRM_VC4_KUNIT_TEST config option itself states
|
||||
# that it is only useful for kernel developers working on the
|
||||
# vc4 driver. So, I feel no need to deviate from the standard
|
||||
# rpi kernel and attempt to successfully enable this test and
|
||||
# other unit tests because the nixos perl script has this
|
||||
# sloppy "default to m" behavior. So, I set KUNIT to `n`.
|
||||
#
|
||||
# [1] https://github.com/NixOS/nixpkgs/blob/85bcb95aa83be667e562e781e9d186c57a07d757/pkgs/os-specific/linux/kernel/generate-config.pl#L1-L10
|
||||
# [2] https://github.com/raspberrypi/linux/blob/1.20230405/lib/kunit/Kconfig#L5-L14
|
||||
# [3] https://github.com/raspberrypi/linux/blob/bb63dc31e48948bc2649357758c7a152210109c4/drivers/gpu/drm/vc4/Kconfig#L38-L52
|
||||
KUNIT = no;
|
||||
HID_LENOVO = no;
|
||||
};
|
||||
features.efiBootStub = false;
|
||||
kernelPatches =
|
||||
if kernel ? "patches" then kernel.patches else [ ];
|
||||
}).overrideAttrs
|
||||
(oldAttrs: {
|
||||
postConfigure = ''
|
||||
# The v7 defconfig has this set to '-v7' which screws up our modDirVersion.
|
||||
sed -i $buildRoot/.config -e 's/^CONFIG_LOCALVERSION=.*/CONFIG_LOCALVERSION=""/'
|
||||
sed -i $buildRoot/include/config/auto.conf -e 's/^CONFIG_LOCALVERSION=.*/CONFIG_LOCALVERSION=""/'
|
||||
'';
|
||||
});
|
||||
firmware = prev.raspberrypifw.overrideAttrs (oldfw: { src = kernel.firmware; });
|
||||
|
||||
};
|
||||
};
|
||||
rpi-kernels = builtins.foldl'
|
||||
(b: a: final.lib.recursiveUpdate b (rpi-kernel a))
|
||||
|
|
@ -108,13 +108,12 @@ in
|
|||
}
|
||||
)
|
||||
{ };
|
||||
raspberrypifw = prev.raspberrypifw.overrideAttrs (oldfw: { src = rpi-firmware-src; });
|
||||
|
||||
} // {
|
||||
# rpi kernels and firmware are available at
|
||||
# `pkgs.rpi-kernels.<VERSION>.<BOARD>'.
|
||||
#
|
||||
# For example: `pkgs.rpi-kernels.v6_6_78.bcm2712'
|
||||
# Check all available versions/boards with: nix flake show
|
||||
rpi-kernels = rpi-kernels (
|
||||
final.lib.cartesianProduct
|
||||
{ board = boards; version = (builtins.attrNames versions); }
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
{ rpicam-apps-src
|
||||
, libcamera-src
|
||||
, libpisp-src
|
||||
, lock
|
||||
, ...
|
||||
}:
|
||||
final: prev: {
|
||||
|
|
@ -10,7 +11,7 @@ final: prev: {
|
|||
|
||||
libpisp = final.stdenv.mkDerivation {
|
||||
name = "libpisp";
|
||||
version = "1.0.7";
|
||||
version = lock.nodes.libpisp-src.original.ref;
|
||||
src = libpisp-src;
|
||||
nativeBuildInputs = with final; [ pkg-config meson ninja ];
|
||||
buildInputs = with final; [ nlohmann_json boost ];
|
||||
|
|
@ -18,10 +19,15 @@ final: prev: {
|
|||
# https://github.com/NixOS/nixpkgs/issues/86131
|
||||
BOOST_INCLUDEDIR = "${prev.lib.getDev final.boost}/include";
|
||||
BOOST_LIBRARYDIR = "${prev.lib.getLib final.boost}/lib";
|
||||
# Copy image filters into lib
|
||||
postInstall = ''
|
||||
mkdir -p $out/lib/libpisp/backend
|
||||
cp src/libpisp/backend/*.json $out/lib/libpisp/backend
|
||||
'';
|
||||
};
|
||||
|
||||
libcamera = prev.libcamera.overrideAttrs (old: {
|
||||
version = "0.3.1";
|
||||
version = lock.nodes.libcamera-src.original.ref;
|
||||
src = libcamera-src;
|
||||
buildInputs = old.buildInputs ++ (with final; [
|
||||
libpisp
|
||||
|
|
@ -50,8 +56,12 @@ final: prev: {
|
|||
"-Dlc-compliance=disabled"
|
||||
"-Dcam=disabled"
|
||||
"-Dqcam=disabled"
|
||||
"-Ddocumentation=enabled"
|
||||
"-Ddocumentation=disabled"
|
||||
"-Dpycamera=enabled"
|
||||
];
|
||||
|
||||
# Issue introduced recently
|
||||
# https://github.com/raspberrypi/libcamera/issues/226
|
||||
CXXFLAGS = "-Wno-sign-compare -Wno-stringop-truncation";
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ stdenv.mkDerivation {
|
|||
|
||||
src = rpicam-apps-src;
|
||||
|
||||
nativeBuildInputs = with pkgs; [ meson pkg-config ];
|
||||
nativeBuildInputs = with pkgs; [ meson pkg-config makeWrapper ];
|
||||
buildInputs = with pkgs; [ libjpeg libtiff libcamera libepoxy boost libexif libpng ffmpeg libdrm ninja ];
|
||||
mesonFlags = [
|
||||
"-Denable_qt=disabled"
|
||||
|
|
@ -21,6 +21,17 @@ stdenv.mkDerivation {
|
|||
BOOST_INCLUDEDIR = "${lib.getDev pkgs.boost}/include";
|
||||
BOOST_LIBRARYDIR = "${lib.getLib pkgs.boost}/lib";
|
||||
|
||||
postFixup = let
|
||||
wrap = "wrapProgram $out/bin/rpicam";
|
||||
ipa-var = "--set LIBCAMERA_IPA_PROXY_PATH ${pkgs.libcamera}/libexec/libcamera";
|
||||
in ''
|
||||
${wrap}-hello ${ipa-var}
|
||||
${wrap}-raw ${ipa-var}
|
||||
${wrap}-vid ${ipa-var}
|
||||
${wrap}-jpeg ${ipa-var}
|
||||
${wrap}-still ${ipa-var}
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "Userland tools interfacing with Raspberry Pi cameras";
|
||||
homepage = "https://github.com/raspberrypi/libcamera-apps";
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
{ pinned, core-overlay, libcamera-overlay }:
|
||||
{ pinned, core-overlay, libcamera-overlay, ... }:
|
||||
{ lib, pkgs, config, ... }:
|
||||
|
||||
let
|
||||
|
|
@ -7,6 +7,10 @@ let
|
|||
board = cfg.board;
|
||||
kernel = config.system.build.kernel;
|
||||
initrd = "${config.system.build.initialRamdisk}/${config.system.boot.loader.initrdFile}";
|
||||
|
||||
kernel-with-firmware = pkgs.rpi-kernels."${version}"."${board}";
|
||||
kernel-pkg = kernel-with-firmware.kernel;
|
||||
firmware-pkg = kernel-with-firmware.firmware;
|
||||
in
|
||||
{
|
||||
imports = [ ./config.nix ./i2c.nix ];
|
||||
|
|
@ -14,7 +18,7 @@ in
|
|||
options = with lib; {
|
||||
raspberry-pi-nix = {
|
||||
kernel-version = mkOption {
|
||||
default = "v6_6_51";
|
||||
default = builtins.elemAt (attrNames pkgs.rpi-kernels) 0;
|
||||
type = types.str;
|
||||
description = "Kernel version to build.";
|
||||
};
|
||||
|
|
@ -121,7 +125,7 @@ in
|
|||
TMPFILE="$TARGET_FIRMWARE_DIR/tmp"
|
||||
KERNEL="${kernel}/${config.system.boot.loader.kernelFile}"
|
||||
SHOULD_UBOOT=${if cfg.uboot.enable then "1" else "0"}
|
||||
SRC_FIRMWARE_DIR="${pkgs.raspberrypifw}/share/raspberrypi/boot"
|
||||
SRC_FIRMWARE_DIR="${firmware-pkg}/share/raspberrypi/boot"
|
||||
STARTFILES=("$SRC_FIRMWARE_DIR"/start*.elf)
|
||||
DTBS=("$SRC_FIRMWARE_DIR"/*.dtb)
|
||||
BOOTCODE="$SRC_FIRMWARE_DIR/bootcode.bin"
|
||||
|
|
@ -195,7 +199,7 @@ in
|
|||
mv -T "$TMPFILE" "$TARGET_OVERLAYS_DIR/$(basename "$SRC")"
|
||||
done
|
||||
echo "${
|
||||
builtins.toString pkgs.raspberrypifw
|
||||
builtins.toString firmware-pkg
|
||||
}" > "$STATE_DIRECTORY/firmware-version"
|
||||
rm "$STATE_DIRECTORY/firmware-migration-in-progress"
|
||||
}
|
||||
|
|
@ -227,7 +231,7 @@ in
|
|||
fi
|
||||
|
||||
if [[ -f "$STATE_DIRECTORY/firmware-migration-in-progress" || ! -f "$STATE_DIRECTORY/firmware-version" || $(< "$STATE_DIRECTORY/firmware-version") != ${
|
||||
builtins.toString pkgs.raspberrypifw
|
||||
builtins.toString firmware-pkg
|
||||
} ]]; then
|
||||
migrate_firmware
|
||||
fi
|
||||
|
|
@ -349,7 +353,7 @@ in
|
|||
"reset-raspberrypi" # required for vl805 firmware to load
|
||||
];
|
||||
};
|
||||
kernelPackages = pkgs.linuxPackagesFor pkgs.rpi-kernels."${version}"."${board}";
|
||||
kernelPackages = pkgs.linuxPackagesFor kernel-pkg;
|
||||
loader = {
|
||||
grub.enable = lib.mkDefault false;
|
||||
initScript.enable = !cfg.uboot.enable;
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@
|
|||
board = cfg.board;
|
||||
kernel = "${config.system.build.kernel}/${config.system.boot.loader.kernelFile}";
|
||||
initrd = "${config.system.build.initialRamdisk}/${config.system.boot.loader.initrdFile}";
|
||||
firmware = pkgs.rpi-kernels."${version}"."${board}".firmware;
|
||||
populate-kernel =
|
||||
if cfg.uboot.enable
|
||||
then ''
|
||||
|
|
@ -46,7 +47,7 @@
|
|||
{
|
||||
populateFirmwareCommands = ''
|
||||
${populate-kernel}
|
||||
cp -r ${pkgs.raspberrypifw}/share/raspberrypi/boot/{start*.elf,*.dtb,bootcode.bin,fixup*.dat,overlays} firmware
|
||||
cp -r ${firmware}/share/raspberrypi/boot/{start*.elf,*.dtb,bootcode.bin,fixup*.dat,overlays} firmware
|
||||
cp ${config.hardware.raspberry-pi.config-output} firmware/config.txt
|
||||
'';
|
||||
populateRootCommands =
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue