From 2623817f6841abd36f855392dad6dc9eaa99568d Mon Sep 17 00:00:00 2001 From: Lucian Pricop Date: Fri, 24 Dec 2021 10:25:23 +0200 Subject: [PATCH] new approach 2 --- new2/default.nix | 40 +++++++++------------------------------- 1 file changed, 9 insertions(+), 31 deletions(-) diff --git a/new2/default.nix b/new2/default.nix index 7b6c897..d87f690 100644 --- a/new2/default.nix +++ b/new2/default.nix @@ -5,8 +5,9 @@ ## 1. Import a list of available software packages. ## 2. Pick a list of specific packages. -{ - system ? builtins.currentSystem, +{ pkgs ? import { + inherit system; + }, system ? builtins.currentSystem }: ################################################################################ @@ -35,30 +36,8 @@ let ## Observe: The notation `import (...url...) {...options...}` accepts a list of options. ## This can be useful if you need custom compilation options for some packages. - pkgs = import (fetchTarball https://github.com/NixOS/nixpkgs-channels/archive/nixos-18.09.tar.gz) { - inherit system; - }; - - #### - ## Import an older version of the standard package repository (nixpkgs v18.03). Assign it the name "oldPkgs". - ## - ## Observe: PHP 5.6 and PHP 7.0 are no longer distributed in nixpkgs - ## v18.09+. But you can still get them from nixpkgs v18.03. - ## - ## Observe: This is not commonly done in the official "nixpkgs", but it's - ## handy if you need to mix+match different versions. - ## - ## Observe: Older builds used libmysqlclient instead of mysqlnd. That can - ## be problematic with, e.g., Drush+Drupal 8. So we set some custom build - ## options. - - oldPkgs = import (fetchTarball https://github.com/NixOS/nixpkgs-channels/archive/nixos-18.03.tar.gz) { + pkgs = import (fetchTarball https://github.com/NixOS/nixpkgs-channels/archive/nixos-20.03.tar.gz) { inherit system; - config = { - php = { - mysqlnd = false; - }; - }; }; #### @@ -72,15 +51,14 @@ let ## By default, we download a specific version of loco. But if you had a ## local codebase for development purposes, you could use that instead. - loco = callPackage (fetchTarball https://github.com/totten/loco/archive/v0.2.1.tar.gz) {}; - # loco = callPackage /home/myuser/src/loco { inherit pkgs; }; - - ramdisk = callPackage (fetchTarball https://github.com/totten/ramdisk/archive/5c699fbeb8ce3d8f3862a726e1e2684067b237dd.tar.gz) {}; + ramdisk = callPackage (fetchTarball https://github.com/totten/ramdisk/archive/master.tar.gz) {}; ## Generating php.ini requires some special work. phpExtLoader = extSpec: (callPackage ./.loco/pkgs/php-exts/default.nix ({ inherit pkgs; } // extSpec)); -################################################################################ + sd-core = callPackage (fetchTarball https://git.law/newroco/searchanddisplace-core/archive/master.tar.gz) {}; + + ################################################################################ ## Now, we have a list of available software packages. ## Let's define the "locolamp" project and include some specific dependencies. @@ -106,7 +84,6 @@ in [ # pkgs.mailcatcher ## CLI utilities - loco pkgs.bzip2 pkgs.curl pkgs.git @@ -119,6 +96,7 @@ in [ ##pkgs.unzip pkgs.which pkgs.zip + sd-core ## Aside: Downloading a different version of PHP or MySQL or NodeJS is ## simple, but bear in mind: this is upgrading (or downgrading). You