mirror of
https://github.com/nix-community/dream2nix.git
synced 2024-12-18 20:11:33 +03:00
php: simple builder add devShell
This commit is contained in:
parent
eec7febc8d
commit
44d95b3adc
@ -44,6 +44,13 @@
|
|||||||
(name: version: {"${version}" = makePackage name version;})
|
(name: version: {"${version}" = makePackage name version;})
|
||||||
args.packages
|
args.packages
|
||||||
);
|
);
|
||||||
|
devShells =
|
||||||
|
{default = devShells.${defaultPackageName};}
|
||||||
|
// (
|
||||||
|
l.mapAttrs
|
||||||
|
(name: version: packages.${name}.${version}.devShell)
|
||||||
|
args.packages
|
||||||
|
);
|
||||||
|
|
||||||
# Generates a derivation for a specific package name + version
|
# Generates a derivation for a specific package name + version
|
||||||
makePackage = name: version: let
|
makePackage = name: version: let
|
||||||
@ -135,11 +142,20 @@
|
|||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
passthru.devShell = import ./devShell.nix {
|
||||||
|
inherit
|
||||||
|
name
|
||||||
|
pkg
|
||||||
|
;
|
||||||
|
inherit (pkgs) mkShell;
|
||||||
|
php = pkgs.php81;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
# apply packageOverrides to current derivation
|
# apply packageOverrides to current derivation
|
||||||
produceDerivation name pkg;
|
produceDerivation name pkg;
|
||||||
in {
|
in {
|
||||||
inherit packages;
|
inherit packages devShells;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
24
src/subsystems/php/builders/simple/devShell.nix
Normal file
24
src/subsystems/php/builders/simple/devShell.nix
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
{
|
||||||
|
name,
|
||||||
|
pkg,
|
||||||
|
mkShell,
|
||||||
|
php,
|
||||||
|
}:
|
||||||
|
mkShell {
|
||||||
|
buildInputs = [
|
||||||
|
php
|
||||||
|
];
|
||||||
|
shellHook = let
|
||||||
|
vendorDir =
|
||||||
|
pkg.overrideAttrs (old: {
|
||||||
|
dontInstall = true;
|
||||||
|
})
|
||||||
|
+ "/lib/vendor/${name}/vendor";
|
||||||
|
in ''
|
||||||
|
rm -rf ./vendor
|
||||||
|
mkdir vendor
|
||||||
|
cp -r ${vendorDir}/* vendor/
|
||||||
|
chmod -R +w ./vendor
|
||||||
|
export PATH="$PATH:$(realpath ./vendor)/bin"
|
||||||
|
'';
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user