mirror of
https://github.com/nix-community/dream2nix.git
synced 2024-09-11 14:35:30 +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;})
|
||||
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
|
||||
makePackage = name: version: let
|
||||
@ -135,11 +142,20 @@
|
||||
done
|
||||
fi
|
||||
'';
|
||||
|
||||
passthru.devShell = import ./devShell.nix {
|
||||
inherit
|
||||
name
|
||||
pkg
|
||||
;
|
||||
inherit (pkgs) mkShell;
|
||||
php = pkgs.php81;
|
||||
};
|
||||
};
|
||||
in
|
||||
# apply packageOverrides to current derivation
|
||||
produceDerivation name pkg;
|
||||
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