cmd/fpkg: include nixGL source in inner store
Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
		
							parent
							
								
									56a73bb019
								
							
						
					
					
						commit
						f8d0786509
					
				
							
								
								
									
										13
									
								
								bundle.nix
									
									
									
									
									
								
							
							
						
						
									
										13
									
								
								bundle.nix
									
									
									
									
									
								
							@ -12,6 +12,7 @@
 | 
				
			|||||||
  writeText,
 | 
					  writeText,
 | 
				
			||||||
  vmTools,
 | 
					  vmTools,
 | 
				
			||||||
  runCommand,
 | 
					  runCommand,
 | 
				
			||||||
 | 
					  fetchFromGitHub,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  nix,
 | 
					  nix,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -109,6 +110,13 @@ let
 | 
				
			|||||||
    inherit (ext) call broadcast;
 | 
					    inherit (ext) call broadcast;
 | 
				
			||||||
  };
 | 
					  };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  nixGL = fetchFromGitHub {
 | 
				
			||||||
 | 
					    owner = "nix-community";
 | 
				
			||||||
 | 
					    repo = "nixGL";
 | 
				
			||||||
 | 
					    rev = "310f8e49a149e4c9ea52f1adf70cdc768ec53f8a";
 | 
				
			||||||
 | 
					    hash = "sha256-lnzZQYG0+EXl/6NkGpyIz+FEOc/DSEG57AP1VsdeNrM=";
 | 
				
			||||||
 | 
					  };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  info = builtins.toJSON {
 | 
					  info = builtins.toJSON {
 | 
				
			||||||
    inherit
 | 
					    inherit
 | 
				
			||||||
      name
 | 
					      name
 | 
				
			||||||
@ -144,6 +152,7 @@ let
 | 
				
			|||||||
      + (if allow_dbus then 4 else 0)
 | 
					      + (if allow_dbus then 4 else 0)
 | 
				
			||||||
      + (if allow_pulse then 8 else 0);
 | 
					      + (if allow_pulse then 8 else 0);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    nix_gl = if gpu then nixGL else null;
 | 
				
			||||||
    current_system = nixos.config.system.build.toplevel;
 | 
					    current_system = nixos.config.system.build.toplevel;
 | 
				
			||||||
    activation_package = homeManagerConfiguration.activationPackage;
 | 
					    activation_package = homeManagerConfiguration.activationPackage;
 | 
				
			||||||
  };
 | 
					  };
 | 
				
			||||||
@ -158,7 +167,9 @@ writeScript "fortify-${pname}-bundle-prelude" ''
 | 
				
			|||||||
  nix copy --no-check-sigs --to "$OUT" "${nix}" "${nixos.config.system.build.toplevel}"
 | 
					  nix copy --no-check-sigs --to "$OUT" "${nix}" "${nixos.config.system.build.toplevel}"
 | 
				
			||||||
  nix store --store "$OUT" optimise
 | 
					  nix store --store "$OUT" optimise
 | 
				
			||||||
  chmod -R +r "$OUT/nix/var"
 | 
					  chmod -R +r "$OUT/nix/var"
 | 
				
			||||||
  nix copy --no-check-sigs --to "file://$OUT/res?compression=zstd&compression-level=19¶llel-compression=true" "${homeManagerConfiguration.activationPackage}" "${launcher}"
 | 
					  nix copy --no-check-sigs --to "file://$OUT/res?compression=zstd&compression-level=19¶llel-compression=true" \
 | 
				
			||||||
 | 
					    "${homeManagerConfiguration.activationPackage}" \
 | 
				
			||||||
 | 
					    "${launcher}" ${if gpu then nixGL else ""}
 | 
				
			||||||
  mkdir -p "$OUT/etc"
 | 
					  mkdir -p "$OUT/etc"
 | 
				
			||||||
  tar -C "$OUT/etc" -xf "${etc}/etc.tar"
 | 
					  tar -C "$OUT/etc" -xf "${etc}/etc.tar"
 | 
				
			||||||
  cp "${writeText "bundle.json" info}" "$OUT/bundle.json"
 | 
					  cp "${writeText "bundle.json" info}" "$OUT/bundle.json"
 | 
				
			||||||
 | 
				
			|||||||
@ -40,6 +40,8 @@ type bundleInfo struct {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	// allow gpu access within sandbox
 | 
						// allow gpu access within sandbox
 | 
				
			||||||
	GPU bool `json:"gpu"`
 | 
						GPU bool `json:"gpu"`
 | 
				
			||||||
 | 
						// store path to nixGL source
 | 
				
			||||||
 | 
						NixGL string `json:"nix_gl,omitempty"`
 | 
				
			||||||
	// store path to activate-and-exec script
 | 
						// store path to activate-and-exec script
 | 
				
			||||||
	Launcher string `json:"launcher"`
 | 
						Launcher string `json:"launcher"`
 | 
				
			||||||
	// store path to /run/current-system
 | 
						// store path to /run/current-system
 | 
				
			||||||
 | 
				
			|||||||
@ -98,7 +98,8 @@ func actionInstall(args []string) {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	if app != bundle {
 | 
						if app != bundle {
 | 
				
			||||||
		// do not try to re-install
 | 
							// do not try to re-install
 | 
				
			||||||
		if app.CurrentSystem == bundle.CurrentSystem &&
 | 
							if app.NixGL == bundle.NixGL &&
 | 
				
			||||||
 | 
								app.CurrentSystem == bundle.CurrentSystem &&
 | 
				
			||||||
			app.Launcher == bundle.Launcher &&
 | 
								app.Launcher == bundle.Launcher &&
 | 
				
			||||||
			app.ActivationPackage == bundle.ActivationPackage {
 | 
								app.ActivationPackage == bundle.ActivationPackage {
 | 
				
			||||||
			cleanup()
 | 
								cleanup()
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user