mirror of
				https://github.com/NixOS/nixos-hardware.git
				synced 2025-11-04 09:17:14 +08:00 
			
		
		
		
	apple/t2: add tiny-dfr service
This commit is contained in:
		
				
					committed by
					
						
						mergify[bot]
					
				
			
			
				
	
			
			
			
						parent
						
							17ad09c30c
						
					
				
				
					commit
					7e3a3f3170
				
			
							
								
								
									
										51
									
								
								apple/t2/pkgs/tiny-dfr.nix
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										51
									
								
								apple/t2/pkgs/tiny-dfr.nix
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,51 @@
 | 
			
		||||
{ pkgs, fetchFromGitHub, rustPlatform, ... }:
 | 
			
		||||
 | 
			
		||||
let
 | 
			
		||||
  repo = fetchFromGitHub {
 | 
			
		||||
      owner = "kekrby";
 | 
			
		||||
      repo = "tiny-dfr";
 | 
			
		||||
      rev = "8a5d413cb1dbe2a25b77a9e7f3cb5b9c88ef3ffb";
 | 
			
		||||
      hash = "sha256-l4D7aePz/CYpkRorrvsgIYrvSzoZl59OGcFGJqqJftk=";
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
in
 | 
			
		||||
rustPlatform.buildRustPackage rec {
 | 
			
		||||
  pname = "tiny-dfr";
 | 
			
		||||
  version = repo.rev;
 | 
			
		||||
 | 
			
		||||
  src = repo;
 | 
			
		||||
 | 
			
		||||
  cargoLock.lockFile = "${src}/Cargo.lock";
 | 
			
		||||
 | 
			
		||||
  nativeBuildInputs = with pkgs; [
 | 
			
		||||
    pkg-config
 | 
			
		||||
  ];
 | 
			
		||||
 | 
			
		||||
  buildInputs = with pkgs; [
 | 
			
		||||
    udev
 | 
			
		||||
    glib
 | 
			
		||||
    pango
 | 
			
		||||
    cairo
 | 
			
		||||
    gdk-pixbuf
 | 
			
		||||
    libxml2
 | 
			
		||||
    libinput
 | 
			
		||||
  ];
 | 
			
		||||
 | 
			
		||||
  postPatch = ''
 | 
			
		||||
    substituteInPlace src/main.rs --replace "/usr/share/tiny-dfr/" "$out/share/tiny-dfr/"
 | 
			
		||||
  '';
 | 
			
		||||
 | 
			
		||||
  postInstall = ''
 | 
			
		||||
    mkdir -p $out/etc $out/share
 | 
			
		||||
 | 
			
		||||
    cp -r etc/udev $out/etc/
 | 
			
		||||
    cp -r share/tiny-dfr $out/share/
 | 
			
		||||
  '';
 | 
			
		||||
 | 
			
		||||
  meta = with pkgs.lib; {
 | 
			
		||||
    description = "The most basic dynamic function row daemon possible";
 | 
			
		||||
    homepage = "https://github.com/kekrby/tiny-dfr";
 | 
			
		||||
    license = with licenses; [ asl20 bsd3 cc0 isc lgpl21Plus mit mpl20 unicode-dfs-2016 asl20 asl20-llvm mit unlicense ];
 | 
			
		||||
    maintainers = [];
 | 
			
		||||
  };
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user