Compare commits
5 Commits
be105b8565
...
c1074db99c
Author | SHA1 | Date | |
---|---|---|---|
c1074db99c
|
|||
9af880b03c
|
|||
c6222c90f4
|
|||
e74656a175
|
|||
21feab0889
|
42
flake.lock
generated
42
flake.lock
generated
@@ -107,11 +107,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1722476845,
|
||||
"narHash": "sha256-7gZ8uf3qOox8Vrwd+p9EhUHHLhhK8lis/5KcXGmIaow=",
|
||||
"lastModified": 1722821805,
|
||||
"narHash": "sha256-FGrUPUD+LMDwJsYyNSxNIzFMldtCm8wXiQuyL2PHSrM=",
|
||||
"owner": "nix-community",
|
||||
"repo": "disko",
|
||||
"rev": "7e1b215a0a96efb306ad6440bf706d2b307dc267",
|
||||
"rev": "0257e44f4ad472b54f19a6dd1615aee7fa48ed49",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -206,11 +206,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1719994518,
|
||||
"narHash": "sha256-pQMhCCHyQGRzdfAkdJ4cIWiw+JNuWsTX7f0ZYSyz0VY=",
|
||||
"lastModified": 1722555600,
|
||||
"narHash": "sha256-XOQkdLafnb/p9ij77byFQjDf5m5QYl9b2REiVClC+x4=",
|
||||
"owner": "hercules-ci",
|
||||
"repo": "flake-parts",
|
||||
"rev": "9227223f6d922fee3c7b190b2cc238a99527bbb7",
|
||||
"rev": "8471fe90ad337a8074e957b69ca4d0089218391d",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -407,11 +407,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1722500642,
|
||||
"narHash": "sha256-Vls0TQRdplex1JslnBxEk3M26Q1vR+OSg+sk5rBG4DA=",
|
||||
"lastModified": 1722609272,
|
||||
"narHash": "sha256-Kkb+ULEHVmk07AX+OhwyofFxBDpw+2WvsXguUS2m6e4=",
|
||||
"owner": "lnl7",
|
||||
"repo": "nix-darwin",
|
||||
"rev": "b47af8628624856ad6853168298f1f96364d92d6",
|
||||
"rev": "f7142b8024d6b70c66fd646e1d099d3aa5bfec49",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -493,11 +493,11 @@
|
||||
},
|
||||
"nixpkgs-unstable": {
|
||||
"locked": {
|
||||
"lastModified": 1722421184,
|
||||
"narHash": "sha256-/DJBI6trCeVnasdjUo9pbnodCLZcFqnVZiLUfqLH4jA=",
|
||||
"lastModified": 1722630782,
|
||||
"narHash": "sha256-hMyG9/WlUi0Ho9VkRrrez7SeNlDzLxalm9FwY7n/Noo=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "9f918d616c5321ad374ae6cb5ea89c9e04bf3e58",
|
||||
"rev": "d04953086551086b44b6f3c6b7eeb26294f207da",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -524,11 +524,11 @@
|
||||
},
|
||||
"nixpkgs_3": {
|
||||
"locked": {
|
||||
"lastModified": 1722519197,
|
||||
"narHash": "sha256-VEdJmVU2eLFtLqCjTYJd1J7+Go8idAcZoT11IewFiRg=",
|
||||
"lastModified": 1722791413,
|
||||
"narHash": "sha256-rCTrlCWvHzMCNcKxPE3Z/mMK2gDZ+BvvpEVyRM4tKmU=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "05405724efa137a0b899cce5ab4dde463b4fd30b",
|
||||
"rev": "8b5b6723aca5a51edf075936439d9cd3947b7b2c",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -567,11 +567,11 @@
|
||||
"treefmt-nix": "treefmt-nix"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1722542912,
|
||||
"narHash": "sha256-88fmVMPFs3ZN+W7Nqd3PYukUOfY4jwc5uvMJXnFhJ20=",
|
||||
"lastModified": 1722688115,
|
||||
"narHash": "sha256-Ubk5KzAp2Z4Dzmi81aGgabvy41QXjZMwNikDYm7+jS0=",
|
||||
"owner": "nix-community",
|
||||
"repo": "nixvim",
|
||||
"rev": "76f309d00fb5a6eeb59c13e9b36b4cf86a209d7f",
|
||||
"rev": "4e6974c619bd280789ef3697a73fcf7c20f70819",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -591,11 +591,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1722693897,
|
||||
"narHash": "sha256-Gpa3Gf60AqshNJKUP5mAmVImFFQ6BsWG+zbqx0JGFD4=",
|
||||
"lastModified": 1722804745,
|
||||
"narHash": "sha256-l6N3QaiDqN2QmHDAxjczQPLPCTv+Kp7PsrtJBltmhTo=",
|
||||
"owner": "nix-community",
|
||||
"repo": "plasma-manager",
|
||||
"rev": "b17a2666bcf400cf245528d143597d1480e298f8",
|
||||
"rev": "61d9342fb471cd3c45a047406428fba7b6fb49ad",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@@ -70,7 +70,7 @@
|
||||
overlays = [
|
||||
agenix.overlays.default
|
||||
(import ./overlays/gnome.nix)
|
||||
(import ./overlays/default.nix)
|
||||
(import ./overlays/libcamera.nix)
|
||||
(
|
||||
final: prev: {
|
||||
unstable = import inputs.nixpkgs-unstable { system = final.system; };
|
||||
@@ -108,6 +108,12 @@
|
||||
};
|
||||
in
|
||||
{
|
||||
legacyPackages = forEachSystem (system:
|
||||
lib.packagesFromDirectoryRecursive {
|
||||
callPackage = nixpkgs.legacyPackages.${system}.callPackage;
|
||||
directory = ./pkgs;
|
||||
});
|
||||
|
||||
nixosConfigurations = {
|
||||
atlas = mkNixosSystem { system = "x86_64-linux"; name = "atlas"; };
|
||||
eos = mkNixosSystem { system = "x86_64-linux"; name = "eos"; };
|
||||
|
@@ -42,6 +42,16 @@
|
||||
extraOptions = ''
|
||||
experimental-features = nix-command flakes
|
||||
'';
|
||||
buildMachines = [
|
||||
{
|
||||
hostName = "10.0.1.79";
|
||||
sshUser = "builder";
|
||||
system = "aarch64-linux";
|
||||
maxJobs = 6;
|
||||
speedFactor = 1;
|
||||
}
|
||||
];
|
||||
distributedBuilds = true;
|
||||
settings = {
|
||||
connect-timeout = 5;
|
||||
log-lines = 25;
|
||||
|
@@ -6,7 +6,10 @@
|
||||
../server.nix
|
||||
];
|
||||
|
||||
raspberry-pi-nix.board = "bcm2711";
|
||||
raspberry-pi-nix = {
|
||||
board = "bcm2711";
|
||||
libcamera-overlay.enable = false;
|
||||
};
|
||||
|
||||
networking = {
|
||||
hostId = "731d1660";
|
||||
@@ -25,9 +28,31 @@
|
||||
|
||||
services.openssh.settings.PermitRootLogin = lib.mkForce "prohibit-password";
|
||||
|
||||
systemd.services.ustreamer = {
|
||||
enable = true;
|
||||
description = "uStreamer service";
|
||||
unitConfig = {
|
||||
Type = "simple";
|
||||
ConditionPathExists="/sys/bus/i2c/drivers/imx708/10-001a/video4linux";
|
||||
};
|
||||
serviceConfig = {
|
||||
ExecStart = ''${pkgs.libcamera}/bin/libcamerify ${pkgs.unstable.ustreamer}/bin/ustreamer \
|
||||
--host=0.0.0.0 \
|
||||
--resolution=4608x2592
|
||||
'';
|
||||
DynamicUser = "yes";
|
||||
SupplementaryGroups = [ "video" "i2c" ];
|
||||
Restart = "always";
|
||||
RestartSec = 10;
|
||||
wantedBy = [ "network-online.target" ];
|
||||
confinement.mode = "chroot-only";
|
||||
};
|
||||
};
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
git
|
||||
neovim
|
||||
libcamera
|
||||
libraspberrypi
|
||||
raspberrypi-eeprom
|
||||
v4l-utils
|
||||
|
142
overlays/0001-Remove-relative-config-lookups.patch
Normal file
142
overlays/0001-Remove-relative-config-lookups.patch
Normal file
@@ -0,0 +1,142 @@
|
||||
From 57128bb78f56cadf9e2dcca5ba4d710c3bd478a7 Mon Sep 17 00:00:00 2001
|
||||
From: Jordan Holt <jordan@vimium.com>
|
||||
Date: Mon, 5 Aug 2024 21:53:09 +0100
|
||||
Subject: [PATCH] Remove relative config lookups
|
||||
|
||||
---
|
||||
src/libcamera/ipa_manager.cpp | 16 ----------
|
||||
src/libcamera/ipa_proxy.cpp | 48 ++----------------------------
|
||||
src/libcamera/pipeline_handler.cpp | 21 ++-----------
|
||||
3 files changed, 4 insertions(+), 81 deletions(-)
|
||||
|
||||
diff --git a/src/libcamera/ipa_manager.cpp b/src/libcamera/ipa_manager.cpp
|
||||
index f4e0b633..6d5bbd05 100644
|
||||
--- a/src/libcamera/ipa_manager.cpp
|
||||
+++ b/src/libcamera/ipa_manager.cpp
|
||||
@@ -131,22 +131,6 @@ IPAManager::IPAManager()
|
||||
<< "No IPA found in '" << modulePaths << "'";
|
||||
}
|
||||
|
||||
- /*
|
||||
- * When libcamera is used before it is installed, load IPAs from the
|
||||
- * same build directory as the libcamera library itself.
|
||||
- */
|
||||
- std::string root = utils::libcameraBuildPath();
|
||||
- if (!root.empty()) {
|
||||
- std::string ipaBuildPath = root + "src/ipa";
|
||||
- constexpr int maxDepth = 2;
|
||||
-
|
||||
- LOG(IPAManager, Info)
|
||||
- << "libcamera is not installed. Adding '"
|
||||
- << ipaBuildPath << "' to the IPA search path";
|
||||
-
|
||||
- ipaCount += addDir(ipaBuildPath.c_str(), maxDepth);
|
||||
- }
|
||||
-
|
||||
/* Finally try to load IPAs from the installed system path. */
|
||||
ipaCount += addDir(IPA_MODULE_DIR);
|
||||
|
||||
diff --git a/src/libcamera/ipa_proxy.cpp b/src/libcamera/ipa_proxy.cpp
|
||||
index 69975d8f..cd9284a3 100644
|
||||
--- a/src/libcamera/ipa_proxy.cpp
|
||||
+++ b/src/libcamera/ipa_proxy.cpp
|
||||
@@ -122,33 +122,11 @@ std::string IPAProxy::configurationFile(const std::string &name,
|
||||
}
|
||||
}
|
||||
|
||||
- std::string root = utils::libcameraSourcePath();
|
||||
- if (!root.empty()) {
|
||||
- /*
|
||||
- * When libcamera is used before it is installed, load
|
||||
- * configuration files from the source directory. The
|
||||
- * configuration files are then located in the 'data'
|
||||
- * subdirectory of the corresponding IPA module.
|
||||
- */
|
||||
- std::string ipaConfDir = root + "src/ipa/" + ipaName + "/data";
|
||||
-
|
||||
- LOG(IPAProxy, Info)
|
||||
- << "libcamera is not installed. Loading IPA configuration from '"
|
||||
- << ipaConfDir << "'";
|
||||
-
|
||||
- std::string confPath = ipaConfDir + "/" + name;
|
||||
+ for (const auto &dir : utils::split(IPA_CONFIG_DIR, ":")) {
|
||||
+ std::string confPath = dir + "/" + ipaName + "/" + name;
|
||||
ret = stat(confPath.c_str(), &statbuf);
|
||||
if (ret == 0 && (statbuf.st_mode & S_IFMT) == S_IFREG)
|
||||
return confPath;
|
||||
-
|
||||
- } else {
|
||||
- /* Else look in the system locations. */
|
||||
- for (const auto &dir : utils::split(IPA_CONFIG_DIR, ":")) {
|
||||
- std::string confPath = dir + "/" + ipaName + "/" + name;
|
||||
- ret = stat(confPath.c_str(), &statbuf);
|
||||
- if (ret == 0 && (statbuf.st_mode & S_IFMT) == S_IFREG)
|
||||
- return confPath;
|
||||
- }
|
||||
}
|
||||
|
||||
if (fallbackName.empty()) {
|
||||
@@ -197,28 +175,6 @@ std::string IPAProxy::resolvePath(const std::string &file) const
|
||||
}
|
||||
}
|
||||
|
||||
- /*
|
||||
- * When libcamera is used before it is installed, load proxy workers
|
||||
- * from the same build directory as the libcamera directory itself.
|
||||
- * This requires identifying the path of the libcamera.so, and
|
||||
- * referencing a relative path for the proxy workers from that point.
|
||||
- */
|
||||
- std::string root = utils::libcameraBuildPath();
|
||||
- if (!root.empty()) {
|
||||
- std::string ipaProxyDir = root + "src/libcamera/proxy/worker";
|
||||
-
|
||||
- LOG(IPAProxy, Info)
|
||||
- << "libcamera is not installed. Loading proxy workers from '"
|
||||
- << ipaProxyDir << "'";
|
||||
-
|
||||
- std::string proxyPath = ipaProxyDir + proxyFile;
|
||||
- if (!access(proxyPath.c_str(), X_OK))
|
||||
- return proxyPath;
|
||||
-
|
||||
- return std::string();
|
||||
- }
|
||||
-
|
||||
- /* Else try finding the exec target from the install directory. */
|
||||
std::string proxyPath = std::string(IPA_PROXY_DIR) + proxyFile;
|
||||
if (!access(proxyPath.c_str(), X_OK))
|
||||
return proxyPath;
|
||||
diff --git a/src/libcamera/pipeline_handler.cpp b/src/libcamera/pipeline_handler.cpp
|
||||
index 5ea2ca78..fd8555ca 100644
|
||||
--- a/src/libcamera/pipeline_handler.cpp
|
||||
+++ b/src/libcamera/pipeline_handler.cpp
|
||||
@@ -561,25 +561,8 @@ std::string PipelineHandler::configurationFile(const std::string &subdir,
|
||||
struct stat statbuf;
|
||||
int ret;
|
||||
|
||||
- std::string root = utils::libcameraSourcePath();
|
||||
- if (!root.empty()) {
|
||||
- /*
|
||||
- * When libcamera is used before it is installed, load
|
||||
- * configuration files from the source directory. The
|
||||
- * configuration files are then located in the 'data'
|
||||
- * subdirectory of the corresponding pipeline handler.
|
||||
- */
|
||||
- std::string confDir = root + "src/libcamera/pipeline/";
|
||||
- confPath = confDir + subdir + "/data/" + name;
|
||||
-
|
||||
- LOG(Pipeline, Info)
|
||||
- << "libcamera is not installed. Loading platform configuration file from '"
|
||||
- << confPath << "'";
|
||||
- } else {
|
||||
- /* Else look in the system locations. */
|
||||
- confPath = std::string(LIBCAMERA_DATA_DIR)
|
||||
- + "/pipeline/" + subdir + '/' + name;
|
||||
- }
|
||||
+ confPath = std::string(LIBCAMERA_DATA_DIR)
|
||||
+ + "/pipeline/" + subdir + '/' + name;
|
||||
|
||||
ret = stat(confPath.c_str(), &statbuf);
|
||||
if (ret == 0 && (statbuf.st_mode & S_IFMT) == S_IFREG)
|
||||
--
|
||||
2.44.1
|
||||
|
@@ -1,48 +1,25 @@
|
||||
{ libcamera-src
|
||||
, libpisp-src
|
||||
, ...
|
||||
}:
|
||||
final: prev:
|
||||
{
|
||||
libpisp = final.stdenv.mkDerivation {
|
||||
name = "libpisp";
|
||||
version = "1.0.6";
|
||||
src = libpisp-src;
|
||||
nativeBuildInputs = with final; [ pkg-config meson ninja ];
|
||||
buildInputs = with final; [ nlohmann_json boost ];
|
||||
# Meson is no longer able to pick up Boost automatically.
|
||||
# https://github.com/NixOS/nixpkgs/issues/86131
|
||||
BOOST_INCLUDEDIR = "${prev.lib.getDev final.boost}/include";
|
||||
BOOST_LIBRARYDIR = "${prev.lib.getLib final.boost}/lib";
|
||||
};
|
||||
|
||||
libcamera = prev.libcamera.overrideAttrs (old: {
|
||||
version = "0.2.0";
|
||||
src = libcamera-src;
|
||||
buildInputs = old.buildInputs ++ (with final; [
|
||||
libpisp openssl libtiff
|
||||
(python3.withPackages (ps: with ps; [
|
||||
python3-gnutls pybind11 pyyaml ply
|
||||
]))
|
||||
libglibutil gst_all_1.gst-plugins-base
|
||||
]);
|
||||
patches = [ ./0001-Always-installed.patch ];
|
||||
postPatch = ''
|
||||
patchShebangs utils/
|
||||
patchShebangs src/py/
|
||||
patchShebangs utils/ src/py/
|
||||
'';
|
||||
mesonFlags = [
|
||||
|
||||
patches = [
|
||||
./0001-Remove-relative-config-lookups.patch
|
||||
];
|
||||
|
||||
mesonFlags = old.mesonFlags ++ [
|
||||
"--buildtype=release"
|
||||
"-Dpipelines=rpi/vc4,rpi/pisp"
|
||||
"-Dipas=rpi/vc4,rpi/pisp"
|
||||
"-Dv4l2=true"
|
||||
"-Dpipelines=rpi/vc4"
|
||||
"-Dipas=rpi/vc4"
|
||||
"-Dgstreamer=enabled"
|
||||
"-Dtest=false"
|
||||
"-Dlc-compliance=disabled"
|
||||
"-Dcam=disabled"
|
||||
"-Dqcam=disabled"
|
||||
"-Ddocumentation=enabled"
|
||||
"-Dpycamera=enabled"
|
||||
"-Dcam=enabled"
|
||||
];
|
||||
});
|
||||
|
||||
camera-streamer = prev.callPackage ../pkgs/camera-streamer/package.nix {
|
||||
libcamera = final.libcamera;
|
||||
};
|
||||
}
|
||||
|
Reference in New Issue
Block a user