downloading modules now actually works

This commit is contained in:
Sebastian Moser
2024-10-06 19:53:37 +02:00
parent d98585e026
commit e9c58c7045
2 changed files with 28 additions and 15 deletions

12
lib.nix
View File

@@ -363,13 +363,15 @@ rec {
mkModulesInstallPhase = modules: pkgs.lib.concatStringsSep "\n" (map mkModuleInstallPhase modules);
mkModuleInstallPhase = module: ''
mkModuleInstallPhase = module: let
hash = builtins.substring 0 32 (builtins.hashString "sha256" module.selector_string);
in ''
echo got module: ${module.name}
echo out: $out
hash=$(echo ${module.selector_string} | sha256sum | cut -c -32)
cp --no-preserve=mode,ownership -r ${module}/* $out/mize/dist/$hash-${module.modName}
${pkgs.gnutar}/bin/tar -czf $out/mize/dist/$hash-${module.modName}.tar.gz -C ${module} .
echo '${module.selector_string}' > $out/mize/dist/$hash-${module.modName}/selector
echo hash: ${hash}
cp --no-preserve=mode,ownership -r ${module}/* $out/mize/dist/${hash}-${module.modName}
${pkgs.gnutar}/bin/tar -czf $out/mize/dist/${hash}-${module.modName}.tar.gz -C ${module} .
echo '${module.selector_string}' > $out/mize/dist/${hash}-${module.modName}/selector
'';
webfiles = systems: stdenv.mkDerivation {