Browse Source

more nix improvements

master
Lucian Pricop 4 years ago
parent
commit
1abed883f1
  1. BIN
      channel.tar.bz2
  2. 66
      composer.json
  3. 9
      default.nix
  4. 0
      pkgs/composer-env.nix
  5. 21
      pkgs/earlier.nix
  6. 4
      pkgs/sandd-php-packages.nix
  7. 28
      pkgs/sandd.nix
  8. 26
      readme.md

BIN
channel.tar.bz2

66
composer.json

@ -1,66 +0,0 @@
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
"php": ">=7.1.3",
"doctrine/dbal": "^2.9",
"enqueue/amqp-bunny": "^0.10.0",
"enqueue/simple-client": "^0.10.0",
"fideloper/proxy": "~4.0",
"intervention/image": "^2.5",
"jasig/phpcas": "1.3.4",
"laravel/framework": "^5.7.7",
"laravel/tinker": "~1.0",
"maatwebsite/excel": "^3.1",
"subfission/cas": "2.0.9",
"symfony/process": "^4.4.1"
},
"require-dev": {
"beyondcode/laravel-er-diagram-generator": "^1.4",
"filp/whoops": "~2.0",
"fzaninotto/faker": "~1.4",
"mockery/mockery": "~1.0",
"phpunit/phpunit": "~7.0"
},
"autoload": {
"classmap": [
"database/seeds",
"database/factories"
],
"psr-4": {
"App\\": "app/"
}
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
},
"extra": {
"laravel": {
"dont-discover": [
"TelescopeServiceProvider"
]
}
},
"scripts": {
"post-root-package-install": [
"@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"@php artisan key:generate"
],
"post-autoload-dump": [
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
"@php artisan package:discover"
]
},
"config": {
"preferred-install": "dist",
"sort-packages": true,
"optimize-autoloader": true
}
}

9
default.nix

@ -0,0 +1,9 @@
{ system ? builtins.currentSystem }:
let
pkgs = import <nixpkgs> { inherit system; };
#self = in self
in rec {
search-and-displace = pkgs.callPackage ./pkgs/sandd.nix {
inherit pkgs;
};
}

0
composer-env.nix → pkgs/composer-env.nix

21
sandd.nix → pkgs/earlier.nix

@ -3,7 +3,19 @@
}, system ? builtins.currentSystem
}:
let
name = "search-and-diplace";
name = "search-and-displace";
# gitStore = builtins.fetchGit {
# url = "https://github.com/searchanddisplace/searchanddisplace.git";
# ref = "master";
# };
# builtins.filterSource
# (path: type: baseNameOf path != "sandd-php-packages.nix" || baseNameOf path != "earlier.nix" || baseNameOf path != "composer-env.nix")
# (builtins.fetchGit {
# url = "https://github.com/searchanddisplace/searchanddisplace.git";
# ref = "master";
# });
inherit (pkgs) stdenv;
composerEnv = import ./composer-env.nix {
inherit (pkgs) stdenv writeTextFile fetchurl php unzip phpPackages;
@ -11,19 +23,16 @@ let
phpPackage = import ./sandd-php-packages.nix {
inherit composerEnv;
inherit (pkgs) fetchurl fetchgit fetchhg fetchsvn;
#src = gitStore;
noDev = true; # Disable development dependencies
inherit name;
};
in
with import (builtins.fetchurl https://github.com/searchanddisplace/searchanddisplace/raw/master/composer.json) {};
phpPackage.override {
#buildCommand = ''
# curl -o composer.json https://github.com/searchanddisplace/searchanddisplace/raw/master/composer.json
#'';
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 ./
'';
}

4
sandd-php-packages.nix → pkgs/sandd-php-packages.nix

@ -1,4 +1,4 @@
{composerEnv, fetchurl, fetchgit ? null, fetchhg ? null, fetchsvn ? null, noDev ? false, name ? "default"}:
{composerEnv, fetchurl, fetchgit ? null, fetchhg ? null, fetchsvn ? null, src ? ./., noDev ? false, name ? "default"}:
let
packages = {
@ -10,7 +10,7 @@ in
composerEnv.buildPackage {
inherit packages devPackages noDev;
inherit name;
src = ./.;
inherit src;
executable = false;
symlinkDependencies = false;
meta = {};

28
pkgs/sandd.nix

@ -0,0 +1,28 @@
{ pkgs ? import <nixpkgs> {
inherit system;
}, system ? builtins.currentSystem
}:
let
name = "search-and-displace";
inherit (pkgs) stdenv git curl php phpPackages;
inherit (phpPackages) composer;
gitStore = builtins.fetchGit {
url = "https://github.com/searchanddisplace/searchanddisplace.git";
ref = "master";
};
buildPackage = { name, src }:
stdenv.mkDerivation {
inherit name src;
buildInputs = [ ];
buildCommand = ''
composer install
npm install
cp .env.example .env
# Remove stuff not needed on production - composer.loc, .json, etc, etc
'';
};
in
buildPackage {
inherit name;
src = gitStore;
}

26
readme.md

@ -0,0 +1,26 @@
## Search & Displace
## :information_source: About
Search and Displace is developing a workflow and toolchain which intends to address
the problem of mass search and displacement for document content where the original
documents are in a range of forms, including a wide variety of digital document formats,
both binary and more modern compressed XML forms, but also encompassing older documents
where the only surviving form is printed or even handwritten.
## :rocket: Installation
First install nix following the instructions on their website at https://nixos.org/nix/manual/#chap-installation
The add searchanddiplace channel to your nix environment and update it:
```bash
nix-channel --add https://github.com/searchanddisplace/searchanddisplace/channel.tar.bz2
nix-channel --update
```
You can now install search-and-displace:
nix-env -iA searchanddisplace.default
## :roller_coaster: Usage
Loading…
Cancel
Save