snipe-it: 5.2.0 -> 6.0.0-RC-7

21.11
Andreas Wiese 2022-04-14 01:11:43 +02:00
parent 5496c6acf8
commit 65218d2d20
Signed by: Andreas Wiese
GPG Key ID: 73DF7A85A6EB4B7C
5 changed files with 1093 additions and 671 deletions

View File

@ -8,7 +8,6 @@ let
phpPackage = cfg.phpPackage.withExtensions ({ enabled, all }: phpPackage = cfg.phpPackage.withExtensions ({ enabled, all }:
enabled ++ (with all; [ enabled ++ (with all; [
json
openssl openssl
pdo pdo
mbstring mbstring
@ -37,7 +36,10 @@ let
useSSL = with cfg.nginx; (addSSL || forceSSL || onlySSL || enableACME); useSSL = with cfg.nginx; (addSSL || forceSSL || onlySSL || enableACME);
snipe-it = cfg.package.override { inherit (cfg) cacheDir dataDir; }; snipe-it = cfg.package.override {
inherit (cfg) cacheDir dataDir;
php = phpPackage; phpPackages = phpPackage.packages;
};
artisan = pkgs.writeShellScriptBin "snipe-it" '' artisan = pkgs.writeShellScriptBin "snipe-it" ''
cd ${snipe-it} cd ${snipe-it}
@ -61,7 +63,7 @@ in {
phpPackage = mkOption { phpPackage = mkOption {
type = types.package; type = types.package;
default = pkgs.php74; default = pkgs.php80;
description = "PHP package to use."; description = "PHP package to use.";
}; };

View File

@ -4,11 +4,16 @@
let let
inherit (phpPackages) composer; inherit (phpPackages) composer;
filterSrc = src:
builtins.filterSource (path: type: type != "directory" || (baseNameOf path != ".git" && baseNameOf path != ".git" && baseNameOf path != ".svn")) src;
buildZipPackage = { name, src }: buildZipPackage = { name, src }:
stdenv.mkDerivation { stdenv.mkDerivation {
inherit name src; inherit name src;
buildInputs = [ unzip ]; nativeBuildInputs = [ unzip ];
buildCommand = '' buildCommand = ''
shopt -s dotglob
unzip $src unzip $src
baseDir=$(find . -type d -mindepth 1 -maxdepth 1) baseDir=$(find . -type d -mindepth 1 -maxdepth 1)
cd $baseDir cd $baseDir
@ -133,10 +138,9 @@ let
''} ''}
'') (builtins.attrNames dependencies); '') (builtins.attrNames dependencies);
extraArgs = removeAttrs args [ "name" "packages" "devPackages" "buildInputs" ]; extraArgs = removeAttrs args [ "packages" "devPackages" "buildInputs" ];
in in
stdenv.mkDerivation ({ stdenv.mkDerivation ({
name = "composer-${name}";
buildInputs = [ php composer ] ++ buildInputs; buildInputs = [ php composer ] ++ buildInputs;
inherit unpackPhase buildPhase; inherit unpackPhase buildPhase;
@ -233,6 +237,7 @@ let
} // extraArgs); } // extraArgs);
in in
{ {
inherit filterSrc;
composer = lib.makeOverridable composer; composer = lib.makeOverridable composer;
buildZipPackage = lib.makeOverridable buildZipPackage; buildZipPackage = lib.makeOverridable buildZipPackage;
buildPackage = lib.makeOverridable buildPackage; buildPackage = lib.makeOverridable buildPackage;

View File

@ -1,10 +1,11 @@
{pkgs ? import <nixpkgs> { {pkgs ? import <nixpkgs> {
inherit system; inherit system;
}, system ? builtins.currentSystem, noDev ? false}: }, system ? builtins.currentSystem, noDev ? false, php ? pkgs.php, phpPackages ? pkgs.phpPackages}:
let let
composerEnv = import ./composer-env.nix { composerEnv = import ./composer-env.nix {
inherit (pkgs) stdenv lib writeTextFile fetchurl php unzip phpPackages; inherit (pkgs) stdenv lib writeTextFile fetchurl unzip;
inherit php phpPackages;
}; };
in in
import ./php-packages.nix { import ./php-packages.nix {

View File

@ -1,11 +1,12 @@
{ pkgs, system, lib, fetchFromGitHub { pkgs, system, lib, fetchFromGitHub
, php, phpPackages
, dataDir ? "/var/lib/snipe-it" , dataDir ? "/var/lib/snipe-it"
, cacheDir ? "/var/cache/snipe-it" , cacheDir ? "/var/cache/snipe-it"
}: }:
let let
package = (import ./composition.nix { package = (import ./composition.nix {
inherit pkgs system; inherit pkgs system php phpPackages;
noDev = true; noDev = true;
}).overrideAttrs (oldAttrs: { }).overrideAttrs (oldAttrs: {
installPhase = oldAttrs.installPhase + '' installPhase = oldAttrs.installPhase + ''
@ -20,13 +21,13 @@ let
in package.override rec { in package.override rec {
name = "snipe-it"; name = "snipe-it";
version = "5.2.0"; version = "6.0.0-RC-7";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "snipe"; owner = "snipe";
repo = "snipe-it"; repo = "snipe-it";
rev = "v${version}"; rev = "v${version}";
sha256 = "sha256-LT1JVHwmprLS52+OWgnddTKam5dEHDSuyHKxFG9WadM="; sha256 = "sha256-GMGKo2qieTX5eR9WGZN7PnsPRUp14EysX1VyCzQZuUo=";
}; };
meta = with lib; { meta = with lib; {

File diff suppressed because it is too large Load Diff