diff --git a/pkgs/composer-env.nix b/pkgs/composer-env.nix index 279b307..4df9cb1 100644 --- a/pkgs/composer-env.nix +++ b/pkgs/composer-env.nix @@ -57,7 +57,7 @@ let else $allPackages = array(); - ${stdenv.lib.optionalString (!noDev) '' + ${lib.optionalString (!noDev) '' if(array_key_exists("packages-dev", $config)) $allPackages = array_merge($allPackages, $config["packages-dev"]); ''} @@ -108,7 +108,7 @@ let }; bundleDependencies = dependencies: - stdenv.lib.concatMapStrings (dependencyName: + lib.concatMapStrings (dependencyName: let dependency = dependencies.${dependencyName}; in @@ -179,24 +179,24 @@ let # Copy or symlink the provided dependencies cd vendor ${bundleDependencies packages} - ${stdenv.lib.optionalString (!noDev) (bundleDependencies devPackages)} + ${lib.optionalString (!noDev) (bundleDependencies devPackages)} cd .. # Reconstruct autoload scripts # We use the optimize feature because Nix packages cannot change after they have been built # Using the dynamic loader for a Nix package is useless since there is nothing to dynamically reload. - composer dump-autoload --optimize ${stdenv.lib.optionalString noDev "--no-dev"} + composer dump-autoload --optimize ${lib.optionalString noDev "--no-dev"} # Run the install step as a validation to confirm that everything works out as expected - composer install --optimize-autoloader ${stdenv.lib.optionalString noDev "--no-dev"} + composer install --optimize-autoloader ${lib.optionalString noDev "--no-dev"} - ${stdenv.lib.optionalString executable '' + ${lib.optionalString executable '' # Reconstruct the bin/ folder if we deploy an executable project ${constructBin} composer.json ln -s $(pwd)/vendor/bin $out/bin ''} - ${stdenv.lib.optionalString (!symlinkDependencies) '' + ${lib.optionalString (!symlinkDependencies) '' # Patch the shebangs if possible if [ -d $(pwd)/vendor/bin ] then @@ -232,7 +232,7 @@ let } // extraArgs); in { - composer = stdenv.lib.makeOverridable composer; - buildZipPackage = stdenv.lib.makeOverridable buildZipPackage; - buildPackage = stdenv.lib.makeOverridable buildPackage; + composer = lib.makeOverridable composer; + buildZipPackage = lib.makeOverridable buildZipPackage; + buildPackage = lib.makeOverridable buildPackage; } diff --git a/pkgs/earlier.nix b/pkgs/default.nix similarity index 75% rename from pkgs/earlier.nix rename to pkgs/default.nix index 177844d..768cd08 100644 --- a/pkgs/earlier.nix +++ b/pkgs/default.nix @@ -4,14 +4,14 @@ }: let name = "search-and-displace"; - # gitStore = builtins.fetchGit { - # url = "https://github.com/searchanddisplace/searchanddisplace.git"; - # ref = "master"; - # }; + gitStore = builtins.fetchGit { + url = "https://git.law/newroco/searchanddisplace-ingest.git"; + ref = "master"; + }; # builtins.filterSource - # (path: type: baseNameOf path != "sandd-php-packages.nix" || baseNameOf path != "earlier.nix" || baseNameOf path != "composer-env.nix") + # (path: type: baseNameOf path != "sandd-php-packages.nix" || baseNameOf path != "testing.nix" || baseNameOf path != "composer-env.nix") # (builtins.fetchGit { - # url = "https://github.com/searchanddisplace/searchanddisplace.git"; + # url = "https://git.law/newroco/searchanddisplace-ingest.git"; # ref = "master"; # }); @@ -23,7 +23,7 @@ let phpPackage = import ./sandd-php-packages.nix { inherit composerEnv; inherit (pkgs) fetchurl fetchgit fetchhg fetchsvn; - #src = gitStore; + src = gitStore; noDev = true; # Disable development dependencies inherit name; }; diff --git a/pkgs/sandd-main.nix b/pkgs/sandd-main.nix index 9d5a7d5..9a80be7 100644 --- a/pkgs/sandd-main.nix +++ b/pkgs/sandd-main.nix @@ -1,9 +1,9 @@ +with import {}; { stdenv, fetchGit, sbcl, unzip, curl, git, openssl, php, phpPackages, nodejs}: let name = "search-and-displace"; gitStore = builtins.fetchGit { - url = "https://github.com/searchanddisplace/searchanddisplace.git"; - #url = "https://github.com/newroco/rocket_integration.git"; + url = "https://git.law/newroco/searchanddisplace.git"; ref = "master"; }; inherit (phpPackages) composer; diff --git a/pkgs/testing.nix b/pkgs/testing.nix new file mode 100644 index 0000000..768cd08 --- /dev/null +++ b/pkgs/testing.nix @@ -0,0 +1,38 @@ +{ pkgs ? import { + inherit system; + }, system ? builtins.currentSystem +}: +let + name = "search-and-displace"; + gitStore = builtins.fetchGit { + url = "https://git.law/newroco/searchanddisplace-ingest.git"; + ref = "master"; + }; + # builtins.filterSource + # (path: type: baseNameOf path != "sandd-php-packages.nix" || baseNameOf path != "testing.nix" || baseNameOf path != "composer-env.nix") + # (builtins.fetchGit { + # url = "https://git.law/newroco/searchanddisplace-ingest.git"; + # ref = "master"; + # }); + + + inherit (pkgs) stdenv; + composerEnv = import ./composer-env.nix { + inherit (pkgs) stdenv writeTextFile fetchurl php unzip phpPackages; + }; + phpPackage = import ./sandd-php-packages.nix { + inherit composerEnv; + inherit (pkgs) fetchurl fetchgit fetchhg fetchsvn; + src = gitStore; + noDev = true; # Disable development dependencies + inherit name; + }; +in +phpPackage.override { + removeComposerArtifacts = true; # Remove composer configuration files + buildInputs = [ pkgs.git ]; # Add here any environment dependency + # Add below all lines of post installation instructions e.g ''npm install'' ? + postInstall = '' + ll ./ + ''; +} \ No newline at end of file