Skip to content

Commit

Permalink
Inherit the passthru into packages
Browse files Browse the repository at this point in the history
This enables us to access packages that are preconfigured using nix
develop. e.g. to allow access to kernel.

`nix develop
.#packages.x86_64-linux.nvidia-jetson-orin-nx-debug-from-x86_64.passthru.eval.config.boot.kernelPackages.kernel.passthru.configfile`

or

`nix-repl> packages.x86_64-linux.nvidia-jetson-orin-nx-debug-from-x86_64.passthru.eval.config.boot.kernelPackages.kernel.passthru.configfile`

Signed-off-by: Brian McGillion <[email protected]>
Co-authored-by: Jonas Chevalier <[email protected]>
  • Loading branch information
brianmcgillion and zimbatm committed Jan 7, 2025
1 parent d4c8989 commit 9dff615
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions targets/nvidia-jetson-orin/flake-module.nix
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,19 @@ let
nvidia-jetson-orin-agx-release = nvidia-jetson-orin "agx" "release" [ ];
nvidia-jetson-orin-nx-debug = nvidia-jetson-orin "nx" "debug" [ ];
nvidia-jetson-orin-nx-release = nvidia-jetson-orin "nx" "release" [ ];

mkHostImage =
eval:
let
pkg = eval.config.system.build.${eval.config.formatAttr};
in
pkg
// {
passthru = pkg.passthru or { } // {
inherit eval;
};
};

generate-nodemoapps =
tgt:
tgt
Expand All @@ -137,15 +150,15 @@ let
hostConfiguration = tgt.hostConfiguration.extendModules {
modules = [ { ghaf.graphics.enableDemoApplications = lib.mkForce false; } ];
};
package = hostConfiguration.config.system.build.${hostConfiguration.config.formatAttr};
package = mkHostImage hostConfiguration;
};
generate-cross-from-x86_64 =
tgt:
tgt
// rec {
name = tgt.name + "-from-x86_64";
hostConfiguration = tgt.hostConfiguration.extendModules { modules = [ ./cross-compilation.nix ]; };
package = hostConfiguration.config.system.build.${hostConfiguration.config.formatAttr};
package = mkHostImage hostConfiguration;
};
# Base targets to use for generating demoapps and cross-compilation targets
baseTargets = [
Expand Down

0 comments on commit 9dff615

Please sign in to comment.