{ lib, buildGo127Module, fetchurl, }: let # The API reference page is Redoc (MIT), served from the web UI's own address. redoc = fetchurl { url = "https://cdn.jsdelivr.net/npm/redoc@2.5.2/bundles/redoc.standalone.js"; hash = "sha256-a+ta6iO3HQkSLuNd6PMm44rsBQ53Tzv7ofNOXDZgiYY="; }; in buildGo127Module { pname = "router-webui"; version = "0.1.0"; src = lib.fileset.toSource { root = ./.; fileset = lib.fileset.unions [ ./go.mod (lib.fileset.fileFilter (f: f.hasExt "go") ./.) ./providers.json ./templates ./static ]; }; # static/redoc.standalone.js is not in the source tree (git ignores it); it # is embedded in the binary with the other static files. preBuild = '' cp ${redoc} static/redoc.standalone.js ''; # Standard library only. vendorHash = null; meta = { description = "Web UI for a nixos-router configured by settings.json"; mainProgram = "router-webui"; }; }