Initial repo for search and displace code (written for, rather than the tools used in the processing)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

130 lines
4.3 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. ## locolamp: Download a collection of binaries for use in "LAMP"-style development
  2. ## (Apache, PHP, NodeJS, etc). Binaries are downloaded from nixpkgs.
  3. ##
  4. ## This file is generally organized into sections:
  5. ## 1. Import a list of available software packages.
  6. ## 2. Pick a list of specific packages.
  7. { pkgs ? import <nixpkgs> {
  8. inherit system;
  9. }, system ? builtins.currentSystem
  10. }:
  11. ################################################################################
  12. ## Import a list of available software packages.
  13. ##
  14. ## Observe: The list of available software comes from Github (`https://github.com/OWNER/PROJECT/archive/REF.tar.gz`).
  15. ## The Github URLs can be changed to reference:
  16. ##
  17. ## - Branches
  18. ## - Tags or commits
  19. ## - Unofficial forks (different owners/projects)
  20. ##
  21. ## Referencing a branch means that `nix-shell` will (from time to time) automatically get
  22. ## newer versions of the packages. Referencing a tag or commit means that
  23. ## the exact versions of the software will be locked.
  24. let
  25. ####
  26. ## Import the standard package repository (nixpkgs v18.09). Assign it the name "pkgs".
  27. ##
  28. ## Observe: The name "pkgs" follows a coding-convention, but it's just a
  29. ## local variable. We could call it anything (as long as we're consistent
  30. ## about it below).
  31. ##
  32. ## Observe: The notation `import (...url...) {...options...}` accepts a list of options.
  33. ## This can be useful if you need custom compilation options for some packages.
  34. pkgs = import (fetchTarball https://github.com/NixOS/nixpkgs-channels/archive/nixos-20.03.tar.gz) {
  35. inherit system;
  36. };
  37. ####
  38. ## Import some specific packages that are not available in nixpkgs.
  39. ## "callPackage" is a common helper/convention that makes it easier to get other packages.
  40. callPackage = path: overrides:
  41. let f = import path;
  42. in f ((builtins.intersectAttrs (builtins.functionArgs f) pkgs) // overrides);
  43. ## By default, we download a specific version of loco. But if you had a
  44. ## local codebase for development purposes, you could use that instead.
  45. #loco = callPackage (fetchTarball https://github.com/totten/loco/archive/v0.4.3.tar.gz) {};
  46. ramdisk = callPackage (fetchTarball https://github.com/totten/ramdisk/archive/5c699fbeb8ce3d8f3862a726e1e2684067b237dd.tar.gz) {};
  47. ## Generating php.ini requires some special work.
  48. phpExtLoader = extSpec: (callPackage ./.loco/pkgs/php-exts/default.nix ({ inherit pkgs; } // extSpec));
  49. sd-core = callPackage (fetchTarball https://git.law/newroco/searchanddisplace-core/archive/master.tar.gz) {};
  50. sd-ingest = callPackage (fetchTarball https://git.law/newroco/searchanddisplace-ingest/archive/master.zip) {};
  51. ################################################################################
  52. ## Now, we have a list of available software packages.
  53. ## Let's define the "locolamp" project and include some specific dependencies.
  54. in [
  55. ## Major services / runtimes
  56. ramdisk
  57. pkgs.apacheHttpd /* ... or pkgs.nginx ... */
  58. ## pkgs.mariadb /* ... or pkgs.mysql57, pkgs.mysql55 ... */
  59. pkgs.nodejs-10_x /* ... or pkgs.nodejs-8_x, pkgs.nodes-6_x ... */
  60. pkgs.redis /* ... or pkgs.memcached ... */
  61. pkgs.php74 /* ... or pkgs.php71, oldPkgs.php70, oldPkgs.php56 ... */
  62. (phpExtLoader {
  63. zendExts = [
  64. ##pkgs.php74Packages.xdebug
  65. ];
  66. stdExts = [
  67. pkgs.php74Packages.redis
  68. ## pkgs.php74Packages.imagick
  69. ];
  70. })
  71. pkgs.python38
  72. (phpExtLoader {
  73. zendExts = [];
  74. stdExts = [
  75. pkgs.python38Packages.supervisor
  76. pkgs.python38Packages.tesserocr
  77. pkgs.python38Packages.pdftotext
  78. pkgs.python38Packages.opencv3
  79. ];
  80. })
  81. # pkgs.mailcatcher
  82. ## CLI utilities
  83. pkgs.bzip2
  84. pkgs.curl
  85. pkgs.git
  86. ##pkgs.gnutar
  87. pkgs.hostname
  88. ##pkgs.ncurses
  89. pkgs.patch
  90. pkgs.php74Packages.composer
  91. ##pkgs.rsync
  92. ##pkgs.unzip
  93. pkgs.which
  94. pkgs.zip
  95. pkgs.sqlite
  96. pkgs.deskew
  97. pkgs.pandoc
  98. pkgs.libreoffice
  99. pkgs.poppler_utils
  100. pkgs.unoconv
  101. pkgs.unpaper
  102. pkgs.haskellPackages.duckling
  103. sd-ingest
  104. sd-core
  105. #loco
  106. ## Aside: Downloading a different version of PHP or MySQL or NodeJS is
  107. ## simple, but bear in mind: this is upgrading (or downgrading). You
  108. ## may need to change configuration files to match. Most services are
  109. ## pretty good about forward-compatibility, but some (*ahem*MySQL*MariaDB*)
  110. ## may give errors and require edits to the configuration.
  111. ]