summary refs log blame commit diff
path: root/pkgs/applications/networking/syncthing/inotify.nix
blob: e33501a17158534ff164d07e43bce13f0d85ce5d (plain) (tree)
1
2
3
4
5
6
7
8
9



                                            
                    



                                                           


                                 
                                                                    

    
                              
 
                  
                                           

                                                                         
                                                                   


                                                                              
                                                                



                                                                              

                                                                 


                                                       
    
 
{ stdenv, buildGoPackage, fetchFromGitHub }:

buildGoPackage rec {
  name = "syncthing-inotify-${version}";
  version = "0.8.6";

  goPackagePath = "github.com/syncthing/syncthing-inotify";

  src = fetchFromGitHub {
    owner  = "syncthing";
    repo   = "syncthing-inotify";
    rev    = "v${version}";
    sha256 = "0z1zpb7av4q5nj2d4yda9jcbjdz4yj3823c29y73yf0gfp26lppl";
  };

  goDeps = ./inotify-deps.nix;

  postInstall = ''
    mkdir -p $bin/lib/systemd/{system,user}

    substitute $src/etc/linux-systemd/system/syncthing-inotify@.service \
               $bin/lib/systemd/system/syncthing-inotify@.service \
               --replace /usr/bin/syncthing-inotify $bin/bin/syncthing-inotify

    substitute $src/etc/linux-systemd/user/syncthing-inotify.service \
               $bin/lib/systemd/user/syncthing-inotify.service \
               --replace /usr/bin/syncthing-inotify $bin/bin/syncthing-inotify
  '';

  meta = with stdenv.lib; {
    homepage = https://github.com/syncthing/syncthing-inotify;
    description = "File watcher intended for use with Syncthing";
    license = licenses.mpl20;
    maintainers = with maintainers; [ joko peterhoeg ];
    platforms = platforms.unix;
  };
}