packages/pkgs/snipe-it/default.nix

40 lines
1.1 KiB
Nix

{ pkgs, system, lib, fetchFromGitHub
, dataDir ? "/var/lib/snipe-it"
, cacheDir ? "/var/cache/snipe-it"
}:
let
package = (import ./composition.nix {
inherit pkgs system;
noDev = true;
}).overrideAttrs (oldAttrs: {
installPhase = oldAttrs.installPhase + ''
rm -R $out/storage $out/public/uploads $out/bootstrap/cache
ln -s ${dataDir}/.env $out/.env
ln -s ${dataDir}/storage $out/storage
ln -s ${dataDir}/uploads $out/public/uploads
ln -s ${dataDir}/database.sqlite $out/database/database.sqlite
ln -s ${cacheDir}/bootstrap $out/bootstrap/cache
'';
});
in package.override rec {
name = "snipe-it";
version = "5.1.4";
src = fetchFromGitHub {
owner = "snipe";
repo = "snipe-it";
rev = "v${version}";
sha256 = "0d39vfgwrflyz5rcflr3xl0in1nwkgz8na4sbnziymibg1cw94lx";
};
meta = with lib; {
description = "A free open source IT asset management system";
homepage = "https://www.snipeitapp.com/";
license = licenses.agpl3;
maintainers = with maintainers; [ aw ];
platforms = platforms.unix;
};
}