2022-12-11 09:51:57 +00:00
|
|
|
{ lib
|
|
|
|
, dataDir ? "/var/lib/snipe-it"
|
2023-10-01 08:52:38 +00:00
|
|
|
, fetchFromGitHub
|
2022-12-11 09:51:57 +00:00
|
|
|
, mariadb
|
2023-04-26 15:46:15 +00:00
|
|
|
, nixosTests
|
2023-07-05 06:57:00 +00:00
|
|
|
, php
|
2022-12-11 09:51:57 +00:00
|
|
|
}:
|
2021-10-27 07:46:58 +00:00
|
|
|
|
2023-10-01 08:52:38 +00:00
|
|
|
php.buildComposerProject (finalAttrs: {
|
2021-10-27 07:46:58 +00:00
|
|
|
pname = "snipe-it";
|
2024-06-28 14:56:49 +00:00
|
|
|
version = "7.0.6";
|
2021-10-27 07:46:58 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "snipe";
|
2023-10-01 08:52:38 +00:00
|
|
|
repo = "snipe-it";
|
|
|
|
rev = "v${finalAttrs.version}";
|
2024-06-28 14:56:49 +00:00
|
|
|
hash = "sha256-WsjUXHbl3HTOrXSeNJrykHv9x5Kbch5GH4yOFKYf+jU=";
|
2021-10-27 07:46:58 +00:00
|
|
|
};
|
|
|
|
|
2024-06-28 14:56:49 +00:00
|
|
|
vendorHash = "sha256-qAypUevd4qGt5WFYfuVx00nRKdk2qf9a0T6l/la8mpA=";
|
2023-10-01 08:52:38 +00:00
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
snipe_it_out="$out/share/php/snipe-it"
|
|
|
|
|
|
|
|
# Before symlinking the following directories, copy the invalid_barcode.gif
|
|
|
|
# to a different location. The `snipe-it-setup` oneshot service will then
|
|
|
|
# copy the file back during bootstrap.
|
|
|
|
mkdir -p $out/share/snipe-it
|
|
|
|
cp $snipe_it_out/public/uploads/barcodes/invalid_barcode.gif $out/share/snipe-it/
|
|
|
|
|
|
|
|
rm -R $snipe_it_out/storage $snipe_it_out/public/uploads $snipe_it_out/bootstrap/cache
|
|
|
|
ln -s ${dataDir}/.env $snipe_it_out/.env
|
|
|
|
ln -s ${dataDir}/storage $snipe_it_out/
|
|
|
|
ln -s ${dataDir}/public/uploads $snipe_it_out/public/uploads
|
|
|
|
ln -s ${dataDir}/bootstrap/cache $snipe_it_out/bootstrap/cache
|
|
|
|
|
|
|
|
chmod +x $snipe_it_out/artisan
|
|
|
|
|
|
|
|
substituteInPlace $snipe_it_out/config/database.php --replace "env('DB_DUMP_PATH', '/usr/local/bin')" "env('DB_DUMP_PATH', '${mariadb}/bin')"
|
|
|
|
'';
|
|
|
|
|
|
|
|
passthru = {
|
|
|
|
tests = nixosTests.snipe-it;
|
|
|
|
phpPackage = php;
|
|
|
|
};
|
2023-04-26 15:46:15 +00:00
|
|
|
|
2021-10-27 07:46:58 +00:00
|
|
|
meta = with lib; {
|
2024-06-07 07:46:46 +00:00
|
|
|
description = "Free open source IT asset/license management system";
|
2021-10-27 07:46:58 +00:00
|
|
|
longDescription = ''
|
|
|
|
Snipe-IT was made for IT asset management, to enable IT departments to track
|
|
|
|
who has which laptop, when it was purchased, which software licenses and accessories
|
|
|
|
are available, and so on.
|
|
|
|
Details for snipe-it can be found on the official website at https://snipeitapp.com/.
|
|
|
|
'';
|
|
|
|
homepage = "https://snipeitapp.com/";
|
2024-04-20 22:31:52 +00:00
|
|
|
changelog = "https://github.com/snipe/snipe-it/releases/tag/v${finalAttrs.version}";
|
2021-10-27 07:46:58 +00:00
|
|
|
license = licenses.agpl3Only;
|
|
|
|
maintainers = with maintainers; [ yayayayaka ];
|
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
2023-10-01 08:52:38 +00:00
|
|
|
})
|