chore: Refactor helix package
This commit is contained in:
		
							parent
							
								
									43c313414d
								
							
						
					
					
						commit
						812f3c80cc
					
				
					 1 changed files with 23 additions and 23 deletions
				
			
		|  | @ -2,34 +2,34 @@ | ||||||
|   inputs, |   inputs, | ||||||
|   system, |   system, | ||||||
|   callPackage, |   callPackage, | ||||||
|   symlinkJoin, |   buildEnv, | ||||||
|   makeWrapper, |  | ||||||
|   lib, |   lib, | ||||||
| }: | }: | ||||||
| let | let | ||||||
|   inherit (inputs.helix.packages."${system}") helix; |   inherit (inputs.helix.packages."${system}") helix; | ||||||
|   helixWithPassthru = helix // { |   runtime = callPackage ./runtime.nix { }; | ||||||
|     passthru = helix.passthru // { |   helix' = helix.overrideAttrs ( | ||||||
|  |     _final: prev: | ||||||
|  |     let | ||||||
|  |       helix-runtime = buildEnv { | ||||||
|  |         name = "helix-runtime"; | ||||||
|  |         paths = [ | ||||||
|  |           runtime | ||||||
|  |           prev.env.HELIX_DEFAULT_RUNTIME | ||||||
|  |         ]; | ||||||
|  |       }; | ||||||
|  |     in | ||||||
|  |     { | ||||||
|  |       env.HELIX_DEFAULT_RUNTIME = toString helix-runtime; | ||||||
|  |     } | ||||||
|  |   ); | ||||||
|  | in | ||||||
|  | helix' | ||||||
|  | // { | ||||||
|  |   passthru = (helix'.passthru or { }) // { | ||||||
|     languages = lib.pipe "${helix.src}/languages.toml" [ |     languages = lib.pipe "${helix.src}/languages.toml" [ | ||||||
|       builtins.readFile |       builtins.readFile | ||||||
|       builtins.fromTOML |       builtins.fromTOML | ||||||
|     ]; |     ]; | ||||||
|   }; |   }; | ||||||
|   }; |  | ||||||
|   runtime = callPackage ./runtime.nix { }; |  | ||||||
| in |  | ||||||
| symlinkJoin { |  | ||||||
|   name = "helix-wrapped"; |  | ||||||
|   paths = [ helixWithPassthru ]; |  | ||||||
|   inherit (helixWithPassthru) meta; |  | ||||||
|   buildInputs = [ |  | ||||||
|     makeWrapper |  | ||||||
|   ]; |  | ||||||
|   postBuild = '' |  | ||||||
|     wrapProgram $out/bin/hx \ |  | ||||||
|     --set HELIX_RUNTIME ${runtime} |  | ||||||
|   ''; |  | ||||||
|   passthru = helixWithPassthru.passthru // { |  | ||||||
|     helix-unwrapped = helixWithPassthru; |  | ||||||
|   }; |  | ||||||
| } | } | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue