Filter the sources of development projects

This commit is contained in:
Sander van der Burg 2022-03-02 00:41:50 +01:00
parent c1f98cdac1
commit 299caca4aa
5 changed files with 9 additions and 4 deletions

View file

@ -18,7 +18,7 @@ in
composerEnv.buildPackage {
inherit packages devPackages noDev;
name = "svanderburg-composer2nix";
src = ./.;
src = composerEnv.filterSrc ./.;
executable = true;
symlinkDependencies = false;
meta = {

View file

@ -67,7 +67,7 @@ class Package extends NixASTNode
{
return new NixFunInvocation(new NixExpression("composerEnv.buildPackage"), array(
"name" => $this->composerConfig->packageName,
"src" => new NixFile("./."),
"src" => new NixFunInvocation(new NixExpression("composerEnv.filterSrc"), new NixFile("./.")),
"executable" => $this->executable,
"packages" => new NixInherit(),
"devPackages" => new NixInherit(),

View file

@ -4,6 +4,10 @@
let
inherit (phpPackages) composer;
filterSrc = src:
builtins.filterSource (path: type: type != "directory" || (baseNameOf path != ".git" && baseNameOf path != ".git" && baseNameOf path != ".svn")) src;
buildZipPackage = { name, src }:
stdenv.mkDerivation {
inherit name src;
@ -233,6 +237,7 @@ let
} // extraArgs);
in
{
inherit filterSrc;
composer = lib.makeOverridable composer;
buildZipPackage = lib.makeOverridable buildZipPackage;
buildPackage = lib.makeOverridable buildPackage;

View file

@ -377,7 +377,7 @@ in
composerEnv.buildPackage {
inherit packages devPackages noDev;
name = "dependencies";
src = ./.;
src = composerEnv.filterSrc ./.;
executable = false;
symlinkDependencies = false;
meta = {};

View file

@ -348,7 +348,7 @@ in
composerEnv.buildPackage {
inherit packages devPackages noDev;
name = "phpunit-phpunit";
src = ./.;
src = composerEnv.filterSrc ./.;
executable = true;
symlinkDependencies = false;
meta = {};