use landingpage flake now

feature/hass
Ingolf Wagner 2022-11-24 13:48:18 +01:00
parent 960c77a651
commit 5bf23593c7
Signed by: palo
GPG Key ID: 76BF5F1928B9618B
5 changed files with 179 additions and 286 deletions

View File

@ -378,6 +378,21 @@
}
},
"flake-utils_5": {
"locked": {
"lastModified": 1644229661,
"narHash": "sha256-1YdnJAsNy69bpcjuoKdOYQX0YxZBiCYZo4Twxerqv7k=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "3cecb5b042f7f209c56ffd8371b2711a290ec797",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils_6": {
"locked": {
"lastModified": 1637014545,
"narHash": "sha256-26IZAc5yzlD9FlDT54io1oqG/bBoyka+FJk5guaX4x4=",
@ -392,7 +407,7 @@
"type": "github"
}
},
"flake-utils_6": {
"flake-utils_7": {
"locked": {
"lastModified": 1631561581,
"narHash": "sha256-3VQMV5zvxaVLvqqUrNz3iJelLw30mIVSfZmAaauM3dA=",
@ -507,6 +522,25 @@
"type": "github"
}
},
"landingpage": {
"inputs": {
"flake-utils": "flake-utils_5",
"nixpkgs": "nixpkgs_2"
},
"locked": {
"lastModified": 1669293824,
"narHash": "sha256-LKKlmFM+B4B2Mzn4nXNOTnaHMAzGeHVAPvA5dFhboh0=",
"owner": "mrVanDalo",
"repo": "landingpage",
"rev": "fd81a841fd1f8a57b8800fff260eed5e2ea96a0b",
"type": "github"
},
"original": {
"owner": "mrVanDalo",
"repo": "landingpage",
"type": "github"
}
},
"nix-eval-jobs": {
"inputs": {
"flake-utils": [
@ -583,7 +617,7 @@
"nixpkgs-fmt": {
"inputs": {
"fenix": "fenix",
"flake-utils": "flake-utils_5",
"flake-utils": "flake-utils_6",
"nixpkgs": [
"nixpkgs"
]
@ -619,6 +653,21 @@
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1645527175,
"narHash": "sha256-WeewqaO48sCctiN+iwgZZEJRU29Si7vHHoLCINAvuk8=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "38346f64616c3176f73ad0f20e51557ec0f3d75d",
"type": "github"
},
"original": {
"owner": "nixos",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_3": {
"locked": {
"lastModified": 1668984258,
"narHash": "sha256-0gDMJ2T3qf58xgcSbYoXiRGUkPWmKyr5C3vcathWhKs=",
@ -634,7 +683,7 @@
"type": "github"
}
},
"nixpkgs_3": {
"nixpkgs_4": {
"locked": {
"lastModified": 1632855891,
"narHash": "sha256-crW76mt9/kbUBiKy/KiSnsQ9JEYgD3StDuYAMVkTbM0=",
@ -648,7 +697,7 @@
"type": "indirect"
}
},
"nixpkgs_4": {
"nixpkgs_5": {
"locked": {
"lastModified": 1668882784,
"narHash": "sha256-L1mHACWrG83j8U/jDtAdQHmVZu+JwVUxRPf5mhuzr2s=",
@ -762,8 +811,8 @@
},
"polygon-art": {
"inputs": {
"flake-utils": "flake-utils_6",
"nixpkgs": "nixpkgs_3"
"flake-utils": "flake-utils_7",
"nixpkgs": "nixpkgs_4"
},
"locked": {
"lastModified": 1632864714,
@ -838,15 +887,15 @@
"home-manager": "home-manager",
"home-manager-utils": "home-manager-utils",
"krops": "krops",
"nixpkgs": "nixpkgs_2",
"landingpage": "landingpage",
"nixpkgs": "nixpkgs_3",
"nixpkgs-fmt": "nixpkgs-fmt",
"nixpkgs-unstable": "nixpkgs-unstable",
"polygon-art": "polygon-art",
"private_assets": "private_assets",
"retiolum": "retiolum",
"secrets": "secrets",
"sops-nix": "sops-nix",
"thinkpad-dock": "thinkpad-dock"
"sops-nix": "sops-nix"
}
},
"rotate-text": {
@ -917,7 +966,7 @@
},
"sops-nix": {
"inputs": {
"nixpkgs": "nixpkgs_4",
"nixpkgs": "nixpkgs_5",
"nixpkgs-22_05": "nixpkgs-22_05"
},
"locked": {
@ -950,22 +999,6 @@
"type": "github"
}
},
"thinkpad-dock": {
"flake": false,
"locked": {
"lastModified": 1617280004,
"narHash": "sha256-nhmYoiHNHk64CjgG7dutVpmrWpdwE3+4G8fGWNANTi8=",
"owner": "oxzi",
"repo": "nixos-thinkpad-dock",
"rev": "c18fe4116b20886c112acec19294e9b96e919526",
"type": "github"
},
"original": {
"owner": "oxzi",
"repo": "nixos-thinkpad-dock",
"type": "github"
}
},
"ts-fold": {
"flake": false,
"locked": {

View File

@ -59,9 +59,9 @@
url = "github:krebs/retiolum";
flake = false;
};
thinkpad-dock = {
url = "github:oxzi/nixos-thinkpad-dock";
flake = false;
landingpage = {
#url = "git+file:///home/palo/dev/landingpage";
url = "github:mrVanDalo/landingpage";
};
};
@ -83,7 +83,7 @@
, secrets
, sops-nix
, retiolum
, thinkpad-dock
, landingpage
}:
let
system = "x86_64-linux";
@ -134,6 +134,7 @@
# we assign the overlay created before to the overlays of nixpkgs.
unstable = nixpkgs-unstable.legacyPackages.${pkgs.system};
polygon-art = polygon-art.packages.${pkgs.system};
landingpage = landingpage.packages.${pkgs.system}.plain;
})
];
};

View File

@ -8,7 +8,6 @@ in {
bitwig-studio3 = callPackage ./bitwig-studio/bitwig-studio3.nix { };
emo = callPackage ./emoji { };
landingpage = callPackage ./landingpage { };
light-control = callPackage ./light-control { };
otpmenu = callPackage ./otpmenu { };
sononym = callPackage ./sononym { };

View File

@ -1,138 +0,0 @@
{ lib
, writeTextFile
, jsonConfig ? { }
, title ? "Landing Page"
, destination ? "/index.html"
, ...
}:
with lib;
writeTextFile {
name = "landingpage";
destination = destination;
text = ''
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>${title}</title>
<!-- The font -->
<link href="https://fonts.googleapis.com/css?family=Dosis&display=swap" rel="stylesheet">
<style>
:root{
font-family: 'Dosis', sans-serif;
}
body {
margin-left:0px;
margin-right:0px;
padding-left:0px;
padding-right:0px;
}
.container {
margin-left:0px;
margin-right:0px;
padding-left:0px;
padding-right:0px;
}
.row-items {
display: flex;
flex-wrap: wrap;
justify-content: center;
}
.row-title{
text-align: center;
padding-top: 7px;
padding-bottom: 2px;
}
.row-text {
text-align: center;
background-color: #e6ffcc;
padding-top: 7px;
padding-bottom: 7px;
}
.item {
display: grid;
grid-template-columns: 250px;
grid-template-rows: auto;
grid-template-areas:
"image"
"text";
margin: 2px;
// border-style: solid;
border-width: 0px;
border-color: #ffe6b3;
background-color: #ffe6b3;
}
.item-image {
grid-area: image;
width: 250px;
height: 180px;
}
.item-caption{
grid-area: text;
padding-bottom: 3px;
};
a {
text-decoration: none;
color: black;
}
a:link {
text-decoration: none;
color: black;
}
a:visited {
text-decoration: none;
color: black;
}
a:hover {
text-decoration: none;
color: black;
}
a:active {
text-decoration: none;
color: black;
}
</style>
</head>
<body>
${let
createItemRow = { titel ? null, text ? null, items ? [ ] }: ''
<div class="row">
${
optionalString (titel != null)
''<h2 class="row-title">${title}</h2>''
}
${
optionalString (text != null) ''
<div class="row-text">
<pre>${text}</pre>
</div>''
}
<div class="row-items">
${concatStringsSep "\n" (map createSubItem items)}
</div>
</div>'';
createSubItem = { label, href, image }:
# const shortLabel = (label.length > 28) ? `''${label.substring(0,25)}...` : label;
''
<div class="item">
<a target="_blank" rel="noopener noreferrer" href="${href}" class="thumbnail">
<img src="${image}" class="item-image">
<div class="item-caption" style="text-align:center;font-weight:bold">
${label}
</div>
</a>
</div>'';
in concatStringsSep "\n" (map createItemRow jsonConfig.items)}
</body>
</html>
'';
}

View File

@ -4,123 +4,121 @@
default = true;
locations."/" = {
root = pkgs.landingpage.override {
jsonConfig = {
items = [
{
text = "Syncthings";
items = map
({ name, host ? "${name}.private", ... }: {
label = name;
href = "http://${host}:8384/";
image = "https://media.giphy.com/media/JoyU4vuzwj6ZA7Ging/giphy.gif";
})
(map (name: { inherit name; }) (lib.attrNames
config.module.cluster.services.tinc."private".hosts));
}
{
text = "netdata";
items = map
({ name, host ? "${name}.private", ... }: {
label = name;
href = "http://${host}:19999/";
image = "https://media.giphy.com/media/BkjdN6MQCDPaw/giphy.gif";
})
(map (name: { inherit name; }) [
"robi"
"pepe"
]);
}
{
text = "Various Links";
items = [
{
label = "NeverSSL";
href = "https://oldslowfreshlight.neverssl.com/";
image = "https://media.giphy.com/media/fyLi0OuWysotq/giphy.gif";
}
{
label = "Hetzner Cloud";
href = "https://console.hetzner.cloud/projects";
image =
"https://media.giphy.com/media/NECZ8crkbXR0k/giphy.gif";
}
{
label = "Pass the Popcorn";
href = "https://passthepopcorn.me/";
image =
"https://media.giphy.com/media/NipFetnQOuKhW/giphy.gif";
}
{
label = "redacted";
href = "https://redacted.ch/";
image =
"https://media.giphy.com/media/ku5EcFe4PNGWA/giphy.gif";
}
{
label = "Cups";
href = "http://localhost:631/";
image =
"https://media.giphy.com/media/7hU7x4GPurk2c/giphy.gif";
}
];
}
{
text = "NixOS";
items = [
{
label = "NixOS Manual";
href = "https://nixos.org/nixos/manual/";
image =
"https://media.giphy.com/media/dsdVyKkSqccEzoPufX/giphy.gif";
}
{
label = "Nixpkgs Manual";
href = "https://nixos.org/nixpkgs/manual/";
image =
"https://media.giphy.com/media/dsdVyKkSqccEzoPufX/giphy.gif";
}
{
label = "NixOS Reference";
href =
"https://storage.googleapis.com/files.tazj.in/nixdoc/manual.html#sec-functions-library";
image =
"https://media.giphy.com/media/LkjlH3rVETgsg/giphy.gif";
}
{
label = "Nix Packages";
href = "https://nixos.org/nixos/packages.html";
image =
"https://media.giphy.com/media/l2YWlohvjPnsvkdEc/giphy.gif";
}
{
label = "NixOS Language specific helpers";
href =
"https://nixos.wiki/wiki/Language-specific_package_helpers";
image =
"https://media.giphy.com/media/LkjlH3rVETgsg/giphy.gif";
}
{
label = "NixOS Weekly";
href = "https://weekly.nixos.org/";
image =
"https://media.giphy.com/media/lXiRLb0xFzmreM8k8/giphy.gif";
}
{
label = "NixOS Security";
href = "https://broken.sh/";
image =
"https://media.giphy.com/media/BqILAHjH1Ttm0/giphy.gif";
}
{
label = "NixOS RFCs";
href = "https://github.com/NixOS/rfcs/";
image =
"https://media.giphy.com/media/Uq9bGjGKg08M0/giphy.gif";
}
];
}
];
};
jsonConfig = [
{
text = "Syncthings";
items = map
({ name, host ? "${name}.private", ... }: {
label = name;
href = "http://${host}:8384/";
image = "https://media.giphy.com/media/JoyU4vuzwj6ZA7Ging/giphy.gif";
})
(map (name: { inherit name; }) (lib.attrNames
config.module.cluster.services.tinc."private".hosts));
}
{
text = "netdata";
items = map
({ name, host ? "${name}.private", ... }: {
label = name;
href = "http://${host}:19999/";
image = "https://media.giphy.com/media/BkjdN6MQCDPaw/giphy.gif";
})
(map (name: { inherit name; }) [
"robi"
"pepe"
]);
}
{
text = "Various Links";
items = [
{
label = "NeverSSL";
href = "https://oldslowfreshlight.neverssl.com/";
image = "https://media.giphy.com/media/fyLi0OuWysotq/giphy.gif";
}
{
label = "Hetzner Cloud";
href = "https://console.hetzner.cloud/projects";
image =
"https://media.giphy.com/media/NECZ8crkbXR0k/giphy.gif";
}
{
label = "Pass the Popcorn";
href = "https://passthepopcorn.me/";
image =
"https://media.giphy.com/media/NipFetnQOuKhW/giphy.gif";
}
{
label = "redacted";
href = "https://redacted.ch/";
image =
"https://media.giphy.com/media/ku5EcFe4PNGWA/giphy.gif";
}
{
label = "Cups";
href = "http://localhost:631/";
image =
"https://media.giphy.com/media/7hU7x4GPurk2c/giphy.gif";
}
];
}
{
text = "NixOS";
items = [
{
label = "NixOS Manual";
href = "https://nixos.org/nixos/manual/";
image =
"https://media.giphy.com/media/dsdVyKkSqccEzoPufX/giphy.gif";
}
{
label = "Nixpkgs Manual";
href = "https://nixos.org/nixpkgs/manual/";
image =
"https://media.giphy.com/media/dsdVyKkSqccEzoPufX/giphy.gif";
}
{
label = "NixOS Reference";
href =
"https://storage.googleapis.com/files.tazj.in/nixdoc/manual.html#sec-functions-library";
image =
"https://media.giphy.com/media/LkjlH3rVETgsg/giphy.gif";
}
{
label = "Nix Packages";
href = "https://nixos.org/nixos/packages.html";
image =
"https://media.giphy.com/media/l2YWlohvjPnsvkdEc/giphy.gif";
}
{
label = "NixOS Language specific helpers";
href =
"https://nixos.wiki/wiki/Language-specific_package_helpers";
image =
"https://media.giphy.com/media/LkjlH3rVETgsg/giphy.gif";
}
{
label = "NixOS Weekly";
href = "https://weekly.nixos.org/";
image =
"https://media.giphy.com/media/lXiRLb0xFzmreM8k8/giphy.gif";
}
{
label = "NixOS Security";
href = "https://broken.sh/";
image =
"https://media.giphy.com/media/BqILAHjH1Ttm0/giphy.gif";
}
{
label = "NixOS RFCs";
href = "https://github.com/NixOS/rfcs/";
image =
"https://media.giphy.com/media/Uq9bGjGKg08M0/giphy.gif";
}
];
}
];
};
};
};