forked from quickshell/quickshell
		
	build: split derivation for extensible wrapper
This commit is contained in:
		
							parent
							
								
									ecc4a1249d
								
							
						
					
					
						commit
						e55d519c28
					
				
					 1 changed files with 83 additions and 54 deletions
				
			
		
							
								
								
									
										39
									
								
								default.nix
									
										
									
									
									
								
							
							
						
						
									
										39
									
								
								default.nix
									
										
									
									
									
								
							| 
						 | 
					@ -43,17 +43,19 @@
 | 
				
			||||||
  withPam ? true,
 | 
					  withPam ? true,
 | 
				
			||||||
  withHyprland ? true,
 | 
					  withHyprland ? true,
 | 
				
			||||||
  withI3 ? true,
 | 
					  withI3 ? true,
 | 
				
			||||||
}: buildStdenv.mkDerivation {
 | 
					}: let
 | 
				
			||||||
 | 
					  unwrapped = buildStdenv.mkDerivation {
 | 
				
			||||||
    pname = "quickshell${lib.optionalString debug "-debug"}";
 | 
					    pname = "quickshell${lib.optionalString debug "-debug"}";
 | 
				
			||||||
    version = "0.1.0";
 | 
					    version = "0.1.0";
 | 
				
			||||||
  src = nix-gitignore.gitignoreSource [] ./.;
 | 
					    src = nix-gitignore.gitignoreSource "/default.nix\n" ./.;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    dontWrapQtApps = true; # see wrappers
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    nativeBuildInputs = [
 | 
					    nativeBuildInputs = [
 | 
				
			||||||
      cmake
 | 
					      cmake
 | 
				
			||||||
      ninja
 | 
					      ninja
 | 
				
			||||||
      qt6.qtshadertools
 | 
					      qt6.qtshadertools
 | 
				
			||||||
      spirv-tools
 | 
					      spirv-tools
 | 
				
			||||||
    qt6.wrapQtAppsHook
 | 
					 | 
				
			||||||
      pkg-config
 | 
					      pkg-config
 | 
				
			||||||
    ]
 | 
					    ]
 | 
				
			||||||
    ++ lib.optional withWayland wayland-scanner;
 | 
					    ++ lib.optional withWayland wayland-scanner;
 | 
				
			||||||
| 
						 | 
					@ -97,10 +99,37 @@
 | 
				
			||||||
    dontStrip = debug;
 | 
					    dontStrip = debug;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    meta = with lib; {
 | 
					    meta = with lib; {
 | 
				
			||||||
    homepage = "https://quickshell.outfoxxed.me";
 | 
					      homepage = "https://quickshell.org";
 | 
				
			||||||
      description = "Flexbile QtQuick based desktop shell toolkit";
 | 
					      description = "Flexbile QtQuick based desktop shell toolkit";
 | 
				
			||||||
      license = licenses.lgpl3Only;
 | 
					      license = licenses.lgpl3Only;
 | 
				
			||||||
      platforms = platforms.linux;
 | 
					      platforms = platforms.linux;
 | 
				
			||||||
      mainProgram = "quickshell";
 | 
					      mainProgram = "quickshell";
 | 
				
			||||||
    };
 | 
					    };
 | 
				
			||||||
}
 | 
					  };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  wrapper = unwrapped.stdenv.mkDerivation {
 | 
				
			||||||
 | 
					    inherit (unwrapped) version meta buildInputs;
 | 
				
			||||||
 | 
					    pname = "${unwrapped.pname}-wrapped";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    nativeBuildInputs = unwrapped.nativeBuildInputs ++ [ qt6.wrapQtAppsHook ];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    dontUnpack = true;
 | 
				
			||||||
 | 
					    dontConfigure = true;
 | 
				
			||||||
 | 
					    dontBuild = true;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    installPhase = ''
 | 
				
			||||||
 | 
					      mkdir -p $out/bin
 | 
				
			||||||
 | 
					      # cp will create .quickshell-wrapped in path, ln will not. It is occasionally useful.
 | 
				
			||||||
 | 
					      cp -r ${unwrapped}/bin/* $out/bin
 | 
				
			||||||
 | 
					      ln -s ${unwrapped}/share $out/share
 | 
				
			||||||
 | 
					      # not /lib
 | 
				
			||||||
 | 
					    '';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    passthru = {
 | 
				
			||||||
 | 
					      unwrapped = unwrapped;
 | 
				
			||||||
 | 
					      withModules = modules: wrapper.overrideAttrs (prev: {
 | 
				
			||||||
 | 
					        buildInputs = prev.buildInputs ++ modules;
 | 
				
			||||||
 | 
					      });
 | 
				
			||||||
 | 
					    };
 | 
				
			||||||
 | 
					  };
 | 
				
			||||||
 | 
					in wrapper
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue