Upstream nixpkgs removed a lot of aliases this time, so we needed to do the following transformations. It's a real shame that aliases only really become discoverable easily when they are removed. * runCommandNoCC -> runCommand * gmailieer -> lieer We also need to work around the fact that home-manager hasn't catched on to this rename. * mysql -> mariadb * pkgconfig -> pkg-config This also affects our Nix fork which needs to be bumped. * prometheus_client -> prometheus-client * rxvt_unicode -> rxvt-unicode-unwrapped * nix-review -> nixpkgs-review * oauth2_proxy -> oauth2-proxy Additionally, some Go-related builders decided to drop support for passing the sha256 hash in directly, so we need to use the generic hash arguments. Change-Id: I84aaa225ef18962937f8616a9ff064822f0d5dc3 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6792 Autosubmit: sterni <sternenseemann@systemli.org> Tested-by: BuildkiteCI Reviewed-by: grfn <grfn@gws.fyi> Reviewed-by: flokli <flokli@flokli.de> Reviewed-by: tazjin <tazjin@tvl.su> Reviewed-by: wpcarro <wpcarro@gmail.com>
		
			
				
	
	
		
			52 lines
		
	
	
	
		
			1.5 KiB
		
	
	
	
		
			Nix
		
	
	
	
	
	
			
		
		
	
	
			52 lines
		
	
	
	
		
			1.5 KiB
		
	
	
	
		
			Nix
		
	
	
	
	
	
{ depot, pkgs, lib, ... }:
 | 
						|
 | 
						|
{
 | 
						|
  # content of the <title> tag
 | 
						|
  title
 | 
						|
  # main part of the page, usually wrapped with <main>
 | 
						|
, content
 | 
						|
  # optional extra html to inject into <head>
 | 
						|
, extraHead ? null
 | 
						|
  # optional extra html to inject into <footer>
 | 
						|
, extraFooter ? null
 | 
						|
  # URL at which static assets are located
 | 
						|
, staticUrl ? "https://static.tvl.fyi/${depot.web.static.drvHash}"
 | 
						|
}@args:
 | 
						|
 | 
						|
let
 | 
						|
  inherit (pkgs) runCommand lib;
 | 
						|
  inherit (depot.tools) cheddar;
 | 
						|
in
 | 
						|
 | 
						|
runCommand "${lib.strings.sanitizeDerivationName title}-index.html"
 | 
						|
{
 | 
						|
  headerPart = ''
 | 
						|
    <!DOCTYPE html>
 | 
						|
    <head>
 | 
						|
      <meta charset="utf-8">
 | 
						|
      <meta name="viewport" content="width=device-width, initial-scale=1">
 | 
						|
      <meta name="description" content="The Virus Lounge">
 | 
						|
      <link rel="stylesheet" type="text/css" href="${staticUrl}/tvl.css" media="all">
 | 
						|
      <link rel="icon" type="image/webp" href="${staticUrl}/favicon.webp">
 | 
						|
      <link rel="alternate" type="application/atom+xml" title="Atom Feed" href="https://tvl.fyi/feed.atom">
 | 
						|
      <title>${title}</title>
 | 
						|
  '' + lib.optionalString (args ? extraHead) extraHead + ''
 | 
						|
    </head>
 | 
						|
    <body class="light">
 | 
						|
  '';
 | 
						|
 | 
						|
  inherit content;
 | 
						|
 | 
						|
  footerPart = ''
 | 
						|
      <hr>
 | 
						|
      <footer>
 | 
						|
        ${depot.web.tvl.footer args}
 | 
						|
      </footer>
 | 
						|
    </body>
 | 
						|
  '';
 | 
						|
 | 
						|
  passAsFile = [ "headerPart" "content" "footerPart" ];
 | 
						|
} ''
 | 
						|
  ${cheddar}/bin/cheddar --about-filter content.md < $contentPath > rendered.html
 | 
						|
  cat $headerPartPath rendered.html $footerPartPath > $out
 | 
						|
''
 |