depot/third_party/nixpkgs/pkgs/servers/web-apps/snipe-it/default.nix
Default email b450903751 Project import generated by Copybara.
GitOrigin-RevId: 74a1793c659d09d7cf738005308b1f86c90cb59b
2022-09-09 16:08:57 +02:00

44 lines
1.5 KiB
Nix

{ pkgs, stdenv, lib, fetchFromGitHub, dataDir ? "/var/lib/snipe-it", mariadb }:
let
package = (import ./composition.nix {
inherit pkgs;
inherit (stdenv.hostPlatform) system;
noDev = true; # Disable development dependencies
}).overrideAttrs (attrs : {
installPhase = attrs.installPhase + ''
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
chmod +x $out/artisan
substituteInPlace config/database.php --replace "env('DB_DUMP_PATH', '/usr/local/bin')" "env('DB_DUMP_PATH', '${mariadb}/bin')"
'';
});
in package.override rec {
pname = "snipe-it";
version = "6.0.10";
src = fetchFromGitHub {
owner = "snipe";
repo = pname;
rev = "v${version}";
sha256 = "sha256-RLUcN2gk3uU2aOqs2poShSRfwQJ6CipxBRqJeO2RNzw=";
};
meta = with lib; {
description = "A free open source IT asset/license management system ";
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/";
license = licenses.agpl3Only;
maintainers = with maintainers; [ yayayayaka ];
platforms = platforms.linux;
};
}