 a19cd4ffb1
			
		
	
	
		a19cd4ffb1
		
	
	
	
	
		
			
			This reverts commit 65a333600d5c88a98d674f637d092807cfc12253. This wasn't tested for correctness with something like fodwatch [0], and should not have been (self-)merged so quickly, especially without further review. It also resulted in the breakage of at least one package [1] (and that's the one we know of and was caught). A few packages that were updated in between this commit and this revert were not reverted back to using `rev`, but other than that, this is a 1:1 revert. [0]: https://codeberg.org/raphaelr/fodwatch [1]: https://github.com/NixOS/nixpkgs/pull/396904 / 758551e4587d75882aebc21a04bee960418f8ce9
		
			
				
	
	
		
			69 lines
		
	
	
		
			1.5 KiB
		
	
	
	
		
			Nix
		
	
	
	
	
	
			
		
		
	
	
			69 lines
		
	
	
		
			1.5 KiB
		
	
	
	
		
			Nix
		
	
	
	
	
	
| {
 | |
|   lib,
 | |
|   stdenv,
 | |
|   fetchFromGitHub,
 | |
|   formats,
 | |
|   systemd,
 | |
| }:
 | |
| 
 | |
| let
 | |
|   ini = formats.ini { };
 | |
| 
 | |
|   unit = ini.generate "systembus-notify.service" {
 | |
|     Unit = {
 | |
|       Description = "system bus notification daemon";
 | |
|     };
 | |
| 
 | |
|     Service = {
 | |
|       Type = "exec";
 | |
|       ExecStart = "@out@/bin/systembus-notify";
 | |
|       PrivateTmp = true;
 | |
|       # NB. We cannot `ProtectHome`, or it would block session dbus access.
 | |
|       InaccessiblePaths = "/home";
 | |
|       ReadOnlyPaths = "/run/user";
 | |
|       ProtectSystem = "strict";
 | |
|       Restart = "on-failure";
 | |
|       Slice = "background.slice";
 | |
|     };
 | |
|   };
 | |
| 
 | |
| in
 | |
| stdenv.mkDerivation rec {
 | |
|   pname = "systembus-notify";
 | |
|   version = "1.1";
 | |
| 
 | |
|   src = fetchFromGitHub {
 | |
|     owner = "rfjakob";
 | |
|     repo = "systembus-notify";
 | |
|     rev = "v${version}";
 | |
|     sha256 = "sha256-WzuBw7LXW54CCMgFE9BSJ2skxaz4IA2BcBny63Ihtt0=";
 | |
|   };
 | |
| 
 | |
|   buildInputs = [ systemd ];
 | |
| 
 | |
|   installPhase = ''
 | |
|     runHook preInstall
 | |
| 
 | |
|     install -Dm555 -t $out/bin systembus-notify
 | |
|     install -Dm444 -t $out/share/systembus-notify systembus-notify.desktop
 | |
| 
 | |
|     install -d $out/lib/systemd/user
 | |
|     substitute ${unit} $out/lib/systemd/user/${unit.name} \
 | |
|       --subst-var out
 | |
| 
 | |
|     runHook postInstall
 | |
|   '';
 | |
| 
 | |
|   # requires a running dbus instance
 | |
|   doCheck = false;
 | |
| 
 | |
|   meta = with lib; {
 | |
|     description = "System bus notification daemon";
 | |
|     homepage = "https://github.com/rfjakob/systembus-notify";
 | |
|     license = licenses.mit;
 | |
|     maintainers = with maintainers; [ peterhoeg ];
 | |
|     platforms = platforms.linux;
 | |
|     mainProgram = "systembus-notify";
 | |
|   };
 | |
| }
 |