{ lib, stdenvNoCC, callPackage, linkFarm, }: let stdenv = stdenvNoCC; in stdenv.mkDerivation (finalAttrs: let self = finalAttrs.finalPackage; in { name = "dynix-modules"; strictDeps = true; __structuredAttrs = true; outputs = [ "out" "modules" ]; src = lib.fileset.toSource { root = ./modules/dynamicism; fileset = lib.fileset.unions [ ./modules/dynamicism ]; }; phases = [ "unpackPhase" "patchPhase" "installPhase" ]; modulesOut = "${placeholder "modules"}/share/nixos/modules/dynix"; installPhase = lib.dedent '' runHook preInstall mkdir -p "$out" cp -r * "$out/" mkdir -p "$modules/share/nixos/modules/dynix" cp --reflink=auto -r "$out/"* "$modulesOut/" ''; passthru.mkDevShell = { path, mkShell, python3Packages, }: let mkShell' = mkShell.override { inherit stdenv; }; pyEnv = python3Packages.python.withPackages (p: [ p.beartype ]); in mkShell' { name = "devshell-for-${self.name}"; packages = [ pyEnv ]; env.PYTHONPATH = [ "${pyEnv}/${pyEnv.sitePackages}" # Cursed. "${path}/nixos/lib/test-driver/src" ] |> lib.concatStringsSep ":"; }; passthru.modulesPath = self.modules + "/share/nixos/modules"; passthru.tests = lib.fix (callPackage ./tests { dynix = self; }).packages; passthru.allTests = linkFarm "dynix-all-tests" self.tests; meta = { longDescription = lib.dedent '' Default output contains the modules at top-level, meant for `import`. The `modules` output contains the modules prefixed under `/share/nixos/modules/dynix`. ''; outputsToInstall = [ "modules" ]; }; })