2022-12-11 09:51:57 +00:00
|
|
|
{ lib
|
|
|
|
, pkgs
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, dataDir ? "/var/lib/snipe-it"
|
|
|
|
, mariadb
|
2023-04-26 15:46:15 +00:00
|
|
|
, nixosTests
|
2023-07-05 06:57:00 +00:00
|
|
|
, php
|
|
|
|
, phpPackages
|
2022-12-11 09:51:57 +00:00
|
|
|
}:
|
2021-10-27 07:46:58 +00:00
|
|
|
|
|
|
|
let
|
|
|
|
package = (import ./composition.nix {
|
2023-07-05 06:57:00 +00:00
|
|
|
inherit pkgs php phpPackages;
|
2021-10-27 07:46:58 +00:00
|
|
|
inherit (stdenv.hostPlatform) system;
|
|
|
|
noDev = true; # Disable development dependencies
|
|
|
|
}).overrideAttrs (attrs : {
|
|
|
|
installPhase = attrs.installPhase + ''
|
2022-08-18 10:51:30 +00:00
|
|
|
# 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 $out/public/uploads/barcodes/invalid_barcode.gif $out/share/snipe-it/
|
|
|
|
|
2021-10-27 07:46:58 +00:00
|
|
|
rm -R $out/storage $out/public/uploads $out/bootstrap/cache
|
|
|
|
ln -s ${dataDir}/.env $out/.env
|
|
|
|
ln -s ${dataDir}/storage $out/
|
|
|
|
ln -s ${dataDir}/public/uploads $out/public/uploads
|
|
|
|
ln -s ${dataDir}/bootstrap/cache $out/bootstrap/cache
|
2022-08-18 10:51:30 +00:00
|
|
|
|
2021-10-27 07:46:58 +00:00
|
|
|
chmod +x $out/artisan
|
2022-08-18 10:51:30 +00:00
|
|
|
|
2022-07-08 20:28:33 +00:00
|
|
|
substituteInPlace config/database.php --replace "env('DB_DUMP_PATH', '/usr/local/bin')" "env('DB_DUMP_PATH', '${mariadb}/bin')"
|
2021-10-27 07:46:58 +00:00
|
|
|
'';
|
|
|
|
});
|
|
|
|
|
|
|
|
in package.override rec {
|
|
|
|
pname = "snipe-it";
|
2023-10-03 10:47:17 +00:00
|
|
|
version = "6.2.1";
|
2021-10-27 07:46:58 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "snipe";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2023-10-03 10:47:17 +00:00
|
|
|
sha256 = "0kx5j9a2fbj9zy0i9r01z3lsbqlf488kn5b42fjs47nfzk1yznvx";
|
2021-10-27 07:46:58 +00:00
|
|
|
};
|
|
|
|
|
2023-04-26 15:46:15 +00:00
|
|
|
passthru.tests = nixosTests.snipe-it;
|
2023-07-05 06:57:00 +00:00
|
|
|
passthru.phpPackage = php;
|
2023-04-26 15:46:15 +00:00
|
|
|
|
2021-10-27 07:46:58 +00:00
|
|
|
meta = with lib; {
|
2022-12-11 09:51:57 +00:00
|
|
|
description = "A 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/";
|
2022-12-11 09:51:57 +00:00
|
|
|
changelog = "https://github.com/snipe/snipe-it/releases/tag/v${version}";
|
2021-10-27 07:46:58 +00:00
|
|
|
license = licenses.agpl3Only;
|
|
|
|
maintainers = with maintainers; [ yayayayaka ];
|
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|