Add favicon
This commit is contained in:
parent
e33af543c8
commit
f2fc22e8f7
4 changed files with 223 additions and 12 deletions
|
|
@ -1,4 +1,9 @@
|
||||||
{pkgs, ...}: let
|
{
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
domain = "tel.weinturm.de";
|
||||||
mkphonebook = pkgs.python3.pkgs.buildPythonPackage {
|
mkphonebook = pkgs.python3.pkgs.buildPythonPackage {
|
||||||
pname = "fieldpoc-mkphonebook";
|
pname = "fieldpoc-mkphonebook";
|
||||||
version = "1.0";
|
version = "1.0";
|
||||||
|
|
@ -21,6 +26,45 @@
|
||||||
--set PYTHONPATH "${pkgs.python3.pkgs.pyyaml}/${pkgs.python3.sitePackages}"
|
--set PYTHONPATH "${pkgs.python3.pkgs.pyyaml}/${pkgs.python3.sitePackages}"
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
webmanifest = lib.generators.toJSON {} {
|
||||||
|
name = "Weinturm";
|
||||||
|
short_name = "Telefonbuch";
|
||||||
|
icons = [
|
||||||
|
{
|
||||||
|
src = "/web-app-manifest-192x192.png";
|
||||||
|
sizes = "192x192";
|
||||||
|
type = "image/png";
|
||||||
|
purpose = "maskable";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
src = "/web-app-manifest-512x512.png";
|
||||||
|
sizes = "512x512";
|
||||||
|
type = "image/png";
|
||||||
|
purpose = "maskable";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
theme_color = "#ffffff";
|
||||||
|
background_color = "#300a8d";
|
||||||
|
display = "standalone";
|
||||||
|
};
|
||||||
|
webmanifestFile = pkgs.writeText "site.webmanifest" webmanifest;
|
||||||
|
webroot = pkgs.stdenvNoCC.mkDerivation {
|
||||||
|
name = "webroot-${domain}";
|
||||||
|
src = ./html;
|
||||||
|
dontBuild = true;
|
||||||
|
installPhase = ''
|
||||||
|
export PATH="$PATH:${pkgs.lib.makeBinPath [pkgs.imagemagick]}"
|
||||||
|
mkdir $out
|
||||||
|
cp "$src/favicon.svg" "$out/favicon.svg"
|
||||||
|
convert -background transparent "$src/favicon.svg" -define icon:auto-resize=16,24,32,48,64,72,96,128,256 "$out/favicon.ico"
|
||||||
|
convert -background transparent "$src/favicon.svg" -resize 180x180 "$out/apple-touch-icon.png"
|
||||||
|
convert -background transparent "$src/favicon.svg" -resize 96x96 "$out/favicon-96x96.png"
|
||||||
|
convert -background transparent "$src/favicon.svg" -resize 192x192 "$out/web-app-manifest-192x192.png"
|
||||||
|
convert -background transparent "$src/favicon.svg" -resize 512x512 "$out/web-app-manifest-512x512.png"
|
||||||
|
cp "${webmanifestFile}" "$out/site.webmanifest"
|
||||||
|
ln -s /persist/html/index.html "$out/index.html"
|
||||||
|
'';
|
||||||
|
};
|
||||||
in {
|
in {
|
||||||
environment.systemPackages = [
|
environment.systemPackages = [
|
||||||
(
|
(
|
||||||
|
|
@ -44,4 +88,13 @@ in {
|
||||||
''
|
''
|
||||||
)
|
)
|
||||||
];
|
];
|
||||||
|
|
||||||
|
services.nginx.virtualHosts = {
|
||||||
|
"${domain}" = {
|
||||||
|
serverAliases = ["tel.weinturm-open-air.de"];
|
||||||
|
enableACME = true;
|
||||||
|
forceSSL = true;
|
||||||
|
root = webroot;
|
||||||
|
};
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
162
hosts/pbx/services/fieldpoc/html/favicon.svg
Normal file
162
hosts/pbx/services/fieldpoc/html/favicon.svg
Normal file
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 38 KiB |
|
|
@ -35,6 +35,12 @@ def generate_html(extensions):
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<title>Telefonbuch</title>
|
<title>Telefonbuch</title>
|
||||||
|
<link rel="icon" type="image/png" href="/favicon-96x96.png" sizes="96x96" />
|
||||||
|
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
||||||
|
<link rel="shortcut icon" href="/favicon.ico" />
|
||||||
|
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png" />
|
||||||
|
<meta name="apple-mobile-web-app-title" content="Telefonbuch" />
|
||||||
|
<link rel="manifest" href="/site.webmanifest" />
|
||||||
<style>
|
<style>
|
||||||
body {
|
body {
|
||||||
font-family: system-ui, sans-serif;
|
font-family: system-ui, sans-serif;
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,4 @@
|
||||||
{config, ...}: let
|
{config, ...}: {
|
||||||
domain = "tel.weinturm.de";
|
|
||||||
in {
|
|
||||||
networking.firewall.allowedTCPPorts = [
|
networking.firewall.allowedTCPPorts = [
|
||||||
config.services.nginx.defaultHTTPListenPort
|
config.services.nginx.defaultHTTPListenPort
|
||||||
config.services.nginx.defaultSSLListenPort
|
config.services.nginx.defaultSSLListenPort
|
||||||
|
|
@ -21,13 +19,5 @@ in {
|
||||||
add_header X-Content-Type-Options nosniff;
|
add_header X-Content-Type-Options nosniff;
|
||||||
add_header X-Frame-Options SAMEORIGIN;
|
add_header X-Frame-Options SAMEORIGIN;
|
||||||
'';
|
'';
|
||||||
virtualHosts = {
|
|
||||||
"${domain}" = {
|
|
||||||
serverAliases = ["tel.weinturm-open-air.de"];
|
|
||||||
enableACME = true;
|
|
||||||
forceSSL = true;
|
|
||||||
root = "/persist/html";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue