nur-packages

My NUR packages
git clone git://git.sikmir.ru/nur-packages
Log | Files | Refs | README | LICENSE

bin.nix (1655B)


      1 { lib, stdenv, fetchfromgh, appimageTools, undmg }:
      2 let
      3   inherit (stdenv.hostPlatform) system;
      4   throwSystem = throw "Unsupported system: ${system}";
      5 
      6   pname = "klogg-bin";
      7   version = "20.12";
      8 
      9   suffix = {
     10     x86_64-linux = "x86_64.AppImage";
     11     x86_64-darwin = "OSX.dmg";
     12   }.${system} or throwSystem;
     13 
     14   src = fetchfromgh {
     15     owner = "variar";
     16     repo = "klogg";
     17     version = "v${version}";
     18     name = "klogg-${version}.0.813-${suffix}";
     19     sha256 = {
     20       x86_64-linux = "1m0yl6bd6ahxqljqfjvd6p9nm4vyr4pyrr1qzm70nn2rn4vi4w83";
     21       x86_64-darwin = "07iyg1i6n5ydg99q75wlbl1jh1n1cdjl3rbia2kx6y7dg80lx0d1";
     22     }.${system} or throwSystem;
     23   };
     24 
     25   appimageContents = appimageTools.extract {
     26     inherit pname version src;
     27   };
     28 
     29   meta = with lib; {
     30     description = "A fast, advanced log explorer based on glogg project";
     31     homepage = "https://klogg.filimonov.dev/";
     32     license = licenses.gpl3Plus;
     33     platforms = [ "x86_64-linux" "x86_64-darwin" ];
     34     maintainers = [ maintainers.sikmir ];
     35     skip.ci = true;
     36   };
     37 
     38   linux = appimageTools.wrapType2 rec {
     39     inherit pname version src meta;
     40 
     41     extraInstallCommands = ''
     42       mv $out/bin/{${pname}-${version},klogg}
     43       install -Dm644 ${appimageContents}/klogg.desktop -t $out/share/applications
     44       install -Dm644 ${appimageContents}/klogg.svg -t $out/share/icons/hicolor/scalable/apps
     45     '';
     46   };
     47 
     48   darwin = stdenv.mkDerivation {
     49     inherit pname version src meta;
     50 
     51     nativeBuildInputs = [ undmg ];
     52 
     53     sourceRoot = ".";
     54 
     55     installPhase = ''
     56       mkdir -p $out/Applications
     57       cp -r *.app $out/Applications
     58     '';
     59   };
     60 in
     61 if stdenv.isDarwin
     62 then darwin
     63 else linux