use landingpage flake now

This commit is contained in:
Ingolf Wagner 2022-11-24 13:48:18 +01:00
parent 960c77a651
commit 5bf23593c7
No known key found for this signature in database
GPG key ID: 76BF5F1928B9618B
5 changed files with 179 additions and 286 deletions

View file

@ -378,6 +378,21 @@
} }
}, },
"flake-utils_5": { "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": { "locked": {
"lastModified": 1637014545, "lastModified": 1637014545,
"narHash": "sha256-26IZAc5yzlD9FlDT54io1oqG/bBoyka+FJk5guaX4x4=", "narHash": "sha256-26IZAc5yzlD9FlDT54io1oqG/bBoyka+FJk5guaX4x4=",
@ -392,7 +407,7 @@
"type": "github" "type": "github"
} }
}, },
"flake-utils_6": { "flake-utils_7": {
"locked": { "locked": {
"lastModified": 1631561581, "lastModified": 1631561581,
"narHash": "sha256-3VQMV5zvxaVLvqqUrNz3iJelLw30mIVSfZmAaauM3dA=", "narHash": "sha256-3VQMV5zvxaVLvqqUrNz3iJelLw30mIVSfZmAaauM3dA=",
@ -507,6 +522,25 @@
"type": "github" "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": { "nix-eval-jobs": {
"inputs": { "inputs": {
"flake-utils": [ "flake-utils": [
@ -583,7 +617,7 @@
"nixpkgs-fmt": { "nixpkgs-fmt": {
"inputs": { "inputs": {
"fenix": "fenix", "fenix": "fenix",
"flake-utils": "flake-utils_5", "flake-utils": "flake-utils_6",
"nixpkgs": [ "nixpkgs": [
"nixpkgs" "nixpkgs"
] ]
@ -619,6 +653,21 @@
} }
}, },
"nixpkgs_2": { "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": { "locked": {
"lastModified": 1668984258, "lastModified": 1668984258,
"narHash": "sha256-0gDMJ2T3qf58xgcSbYoXiRGUkPWmKyr5C3vcathWhKs=", "narHash": "sha256-0gDMJ2T3qf58xgcSbYoXiRGUkPWmKyr5C3vcathWhKs=",
@ -634,7 +683,7 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs_3": { "nixpkgs_4": {
"locked": { "locked": {
"lastModified": 1632855891, "lastModified": 1632855891,
"narHash": "sha256-crW76mt9/kbUBiKy/KiSnsQ9JEYgD3StDuYAMVkTbM0=", "narHash": "sha256-crW76mt9/kbUBiKy/KiSnsQ9JEYgD3StDuYAMVkTbM0=",
@ -648,7 +697,7 @@
"type": "indirect" "type": "indirect"
} }
}, },
"nixpkgs_4": { "nixpkgs_5": {
"locked": { "locked": {
"lastModified": 1668882784, "lastModified": 1668882784,
"narHash": "sha256-L1mHACWrG83j8U/jDtAdQHmVZu+JwVUxRPf5mhuzr2s=", "narHash": "sha256-L1mHACWrG83j8U/jDtAdQHmVZu+JwVUxRPf5mhuzr2s=",
@ -762,8 +811,8 @@
}, },
"polygon-art": { "polygon-art": {
"inputs": { "inputs": {
"flake-utils": "flake-utils_6", "flake-utils": "flake-utils_7",
"nixpkgs": "nixpkgs_3" "nixpkgs": "nixpkgs_4"
}, },
"locked": { "locked": {
"lastModified": 1632864714, "lastModified": 1632864714,
@ -838,15 +887,15 @@
"home-manager": "home-manager", "home-manager": "home-manager",
"home-manager-utils": "home-manager-utils", "home-manager-utils": "home-manager-utils",
"krops": "krops", "krops": "krops",
"nixpkgs": "nixpkgs_2", "landingpage": "landingpage",
"nixpkgs": "nixpkgs_3",
"nixpkgs-fmt": "nixpkgs-fmt", "nixpkgs-fmt": "nixpkgs-fmt",
"nixpkgs-unstable": "nixpkgs-unstable", "nixpkgs-unstable": "nixpkgs-unstable",
"polygon-art": "polygon-art", "polygon-art": "polygon-art",
"private_assets": "private_assets", "private_assets": "private_assets",
"retiolum": "retiolum", "retiolum": "retiolum",
"secrets": "secrets", "secrets": "secrets",
"sops-nix": "sops-nix", "sops-nix": "sops-nix"
"thinkpad-dock": "thinkpad-dock"
} }
}, },
"rotate-text": { "rotate-text": {
@ -917,7 +966,7 @@
}, },
"sops-nix": { "sops-nix": {
"inputs": { "inputs": {
"nixpkgs": "nixpkgs_4", "nixpkgs": "nixpkgs_5",
"nixpkgs-22_05": "nixpkgs-22_05" "nixpkgs-22_05": "nixpkgs-22_05"
}, },
"locked": { "locked": {
@ -950,22 +999,6 @@
"type": "github" "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": { "ts-fold": {
"flake": false, "flake": false,
"locked": { "locked": {

View file

@ -59,9 +59,9 @@
url = "github:krebs/retiolum"; url = "github:krebs/retiolum";
flake = false; flake = false;
}; };
thinkpad-dock = { landingpage = {
url = "github:oxzi/nixos-thinkpad-dock"; #url = "git+file:///home/palo/dev/landingpage";
flake = false; url = "github:mrVanDalo/landingpage";
}; };
}; };
@ -83,7 +83,7 @@
, secrets , secrets
, sops-nix , sops-nix
, retiolum , retiolum
, thinkpad-dock , landingpage
}: }:
let let
system = "x86_64-linux"; system = "x86_64-linux";
@ -134,6 +134,7 @@
# we assign the overlay created before to the overlays of nixpkgs. # we assign the overlay created before to the overlays of nixpkgs.
unstable = nixpkgs-unstable.legacyPackages.${pkgs.system}; unstable = nixpkgs-unstable.legacyPackages.${pkgs.system};
polygon-art = polygon-art.packages.${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 { }; bitwig-studio3 = callPackage ./bitwig-studio/bitwig-studio3.nix { };
emo = callPackage ./emoji { }; emo = callPackage ./emoji { };
landingpage = callPackage ./landingpage { };
light-control = callPackage ./light-control { }; light-control = callPackage ./light-control { };
otpmenu = callPackage ./otpmenu { }; otpmenu = callPackage ./otpmenu { };
sononym = callPackage ./sononym { }; 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; default = true;
locations."/" = { locations."/" = {
root = pkgs.landingpage.override { root = pkgs.landingpage.override {
jsonConfig = { jsonConfig = [
items = [ {
{ text = "Syncthings";
text = "Syncthings"; items = map
items = map ({ name, host ? "${name}.private", ... }: {
({ name, host ? "${name}.private", ... }: { label = name;
label = name; href = "http://${host}:8384/";
href = "http://${host}:8384/"; image = "https://media.giphy.com/media/JoyU4vuzwj6ZA7Ging/giphy.gif";
image = "https://media.giphy.com/media/JoyU4vuzwj6ZA7Ging/giphy.gif"; })
}) (map (name: { inherit name; }) (lib.attrNames
(map (name: { inherit name; }) (lib.attrNames config.module.cluster.services.tinc."private".hosts));
config.module.cluster.services.tinc."private".hosts)); }
} {
{ text = "netdata";
text = "netdata"; items = map
items = map ({ name, host ? "${name}.private", ... }: {
({ name, host ? "${name}.private", ... }: { label = name;
label = name; href = "http://${host}:19999/";
href = "http://${host}:19999/"; image = "https://media.giphy.com/media/BkjdN6MQCDPaw/giphy.gif";
image = "https://media.giphy.com/media/BkjdN6MQCDPaw/giphy.gif"; })
}) (map (name: { inherit name; }) [
(map (name: { inherit name; }) [ "robi"
"robi" "pepe"
"pepe" ]);
]); }
} {
{ text = "Various Links";
text = "Various Links"; items = [
items = [ {
{ label = "NeverSSL";
label = "NeverSSL"; href = "https://oldslowfreshlight.neverssl.com/";
href = "https://oldslowfreshlight.neverssl.com/"; image = "https://media.giphy.com/media/fyLi0OuWysotq/giphy.gif";
image = "https://media.giphy.com/media/fyLi0OuWysotq/giphy.gif"; }
} {
{ label = "Hetzner Cloud";
label = "Hetzner Cloud"; href = "https://console.hetzner.cloud/projects";
href = "https://console.hetzner.cloud/projects"; image =
image = "https://media.giphy.com/media/NECZ8crkbXR0k/giphy.gif";
"https://media.giphy.com/media/NECZ8crkbXR0k/giphy.gif"; }
} {
{ label = "Pass the Popcorn";
label = "Pass the Popcorn"; href = "https://passthepopcorn.me/";
href = "https://passthepopcorn.me/"; image =
image = "https://media.giphy.com/media/NipFetnQOuKhW/giphy.gif";
"https://media.giphy.com/media/NipFetnQOuKhW/giphy.gif"; }
} {
{ label = "redacted";
label = "redacted"; href = "https://redacted.ch/";
href = "https://redacted.ch/"; image =
image = "https://media.giphy.com/media/ku5EcFe4PNGWA/giphy.gif";
"https://media.giphy.com/media/ku5EcFe4PNGWA/giphy.gif"; }
} {
{ label = "Cups";
label = "Cups"; href = "http://localhost:631/";
href = "http://localhost:631/"; image =
image = "https://media.giphy.com/media/7hU7x4GPurk2c/giphy.gif";
"https://media.giphy.com/media/7hU7x4GPurk2c/giphy.gif"; }
} ];
]; }
} {
{ text = "NixOS";
text = "NixOS"; items = [
items = [ {
{ label = "NixOS Manual";
label = "NixOS Manual"; href = "https://nixos.org/nixos/manual/";
href = "https://nixos.org/nixos/manual/"; image =
image = "https://media.giphy.com/media/dsdVyKkSqccEzoPufX/giphy.gif";
"https://media.giphy.com/media/dsdVyKkSqccEzoPufX/giphy.gif"; }
} {
{ label = "Nixpkgs Manual";
label = "Nixpkgs Manual"; href = "https://nixos.org/nixpkgs/manual/";
href = "https://nixos.org/nixpkgs/manual/"; image =
image = "https://media.giphy.com/media/dsdVyKkSqccEzoPufX/giphy.gif";
"https://media.giphy.com/media/dsdVyKkSqccEzoPufX/giphy.gif"; }
} {
{ label = "NixOS Reference";
label = "NixOS Reference"; href =
href = "https://storage.googleapis.com/files.tazj.in/nixdoc/manual.html#sec-functions-library";
"https://storage.googleapis.com/files.tazj.in/nixdoc/manual.html#sec-functions-library"; image =
image = "https://media.giphy.com/media/LkjlH3rVETgsg/giphy.gif";
"https://media.giphy.com/media/LkjlH3rVETgsg/giphy.gif"; }
} {
{ label = "Nix Packages";
label = "Nix Packages"; href = "https://nixos.org/nixos/packages.html";
href = "https://nixos.org/nixos/packages.html"; image =
image = "https://media.giphy.com/media/l2YWlohvjPnsvkdEc/giphy.gif";
"https://media.giphy.com/media/l2YWlohvjPnsvkdEc/giphy.gif"; }
} {
{ label = "NixOS Language specific helpers";
label = "NixOS Language specific helpers"; href =
href = "https://nixos.wiki/wiki/Language-specific_package_helpers";
"https://nixos.wiki/wiki/Language-specific_package_helpers"; image =
image = "https://media.giphy.com/media/LkjlH3rVETgsg/giphy.gif";
"https://media.giphy.com/media/LkjlH3rVETgsg/giphy.gif"; }
} {
{ label = "NixOS Weekly";
label = "NixOS Weekly"; href = "https://weekly.nixos.org/";
href = "https://weekly.nixos.org/"; image =
image = "https://media.giphy.com/media/lXiRLb0xFzmreM8k8/giphy.gif";
"https://media.giphy.com/media/lXiRLb0xFzmreM8k8/giphy.gif"; }
} {
{ label = "NixOS Security";
label = "NixOS Security"; href = "https://broken.sh/";
href = "https://broken.sh/"; image =
image = "https://media.giphy.com/media/BqILAHjH1Ttm0/giphy.gif";
"https://media.giphy.com/media/BqILAHjH1Ttm0/giphy.gif"; }
} {
{ label = "NixOS RFCs";
label = "NixOS RFCs"; href = "https://github.com/NixOS/rfcs/";
href = "https://github.com/NixOS/rfcs/"; image =
image = "https://media.giphy.com/media/Uq9bGjGKg08M0/giphy.gif";
"https://media.giphy.com/media/Uq9bGjGKg08M0/giphy.gif"; }
} ];
]; }
} ];
];
};
}; };
}; };
}; };