zephyr: Put modules in a subdirectory so zephyr doesn't get mad
This commit is contained in:
parent
8483d4813a
commit
453af715ee
|
@ -2,6 +2,7 @@
|
|||
let
|
||||
assets = lib.importJSON ./assets.json;
|
||||
modules = lib.importJSON ./modules.json;
|
||||
buildModule = module: callPackage ./module.nix { inherit module; };
|
||||
in {
|
||||
host-tools = callPackage ./host-tools.nix {
|
||||
inherit (assets) version hosts;
|
||||
|
@ -20,5 +21,5 @@ in {
|
|||
};
|
||||
|
||||
src = fetchFromGitHub modules.zephyr;
|
||||
modules = lib.mapAttrs (_: fetchFromGitHub) modules.modules;
|
||||
modules = lib.mapAttrs (_: buildModule) modules.modules;
|
||||
}
|
||||
|
|
17
packages/zephyr/module.nix
Normal file
17
packages/zephyr/module.nix
Normal file
|
@ -0,0 +1,17 @@
|
|||
{ stdenvNoCC, fetchFromGitHub, version ? null, module }:
|
||||
let src = fetchFromGitHub module;
|
||||
in stdenvNoCC.mkDerivation (finalAttrs: {
|
||||
name = if version != null then
|
||||
"${module.name}-wrapped-${version}"
|
||||
else
|
||||
"${module.name}-wrapped";
|
||||
|
||||
passthru.modulePath = "${finalAttrs.finalPackage.out}/${module.name}";
|
||||
|
||||
passAsFile = [ "buildCommand" ];
|
||||
buildCommand = ''
|
||||
mkdir -p $out
|
||||
ln -s "${src}" "$out/${module.name}"
|
||||
'';
|
||||
})
|
||||
|
|
@ -29,5 +29,6 @@ in mkShell ({
|
|||
PATH="${zephyrSrc}/scripts:$PATH"
|
||||
'';
|
||||
} // lib.optionalAttrs (modules != [ ]) {
|
||||
ZEPHYR_MODULES = lib.concatStringsSep ";" (map (pkg: pkg.out) modules);
|
||||
ZEPHYR_MODULES =
|
||||
lib.concatStringsSep ";" (map (pkg: pkg.passthru.modulePath) modules);
|
||||
} // extraAttrs)
|
||||
|
|
Loading…
Reference in a new issue