From 5bf23593c7dbd17a59fb632e07dbd94ecbcfc0eb Mon Sep 17 00:00:00 2001 From: Ingolf Wagner Date: Thu, 24 Nov 2022 13:48:18 +0100 Subject: [PATCH] use landingpage flake now --- flake.lock | 85 ++++++--- flake.nix | 9 +- nixos/pkgs/default.nix | 1 - nixos/pkgs/landingpage/default.nix | 138 --------------- nixos/system/all/nginx-landingpage.nix | 232 ++++++++++++------------- 5 files changed, 179 insertions(+), 286 deletions(-) delete mode 100644 nixos/pkgs/landingpage/default.nix diff --git a/flake.lock b/flake.lock index 52059fa..084e519 100644 --- a/flake.lock +++ b/flake.lock @@ -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": { diff --git a/flake.nix b/flake.nix index 880b6d0..599f885 100644 --- a/flake.nix +++ b/flake.nix @@ -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; }) ]; }; diff --git a/nixos/pkgs/default.nix b/nixos/pkgs/default.nix index 9884235..31c56ad 100644 --- a/nixos/pkgs/default.nix +++ b/nixos/pkgs/default.nix @@ -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 { }; diff --git a/nixos/pkgs/landingpage/default.nix b/nixos/pkgs/landingpage/default.nix deleted file mode 100644 index abba95d..0000000 --- a/nixos/pkgs/landingpage/default.nix +++ /dev/null @@ -1,138 +0,0 @@ -{ lib -, writeTextFile -, jsonConfig ? { } -, title ? "Landing Page" -, destination ? "/index.html" -, ... -}: - -with lib; - -writeTextFile { - name = "landingpage"; - destination = destination; - text = '' - - - - - ${title} - - - - - - - - ${let - - createItemRow = { titel ? null, text ? null, items ? [ ] }: '' -
- ${ - optionalString (titel != null) - ''

${title}

'' - } - ${ - optionalString (text != null) '' -
-
${text}
-
'' - } -
- ${concatStringsSep "\n" (map createSubItem items)} -
-
''; - - createSubItem = { label, href, image }: - # const shortLabel = (label.length > 28) ? `''${label.substring(0,25)}...` : label; - - '' -
- - -
- ${label} -
-
-
''; - - in concatStringsSep "\n" (map createItemRow jsonConfig.items)} - - - - ''; -} diff --git a/nixos/system/all/nginx-landingpage.nix b/nixos/system/all/nginx-landingpage.nix index fef8f27..2eb6a43 100644 --- a/nixos/system/all/nginx-landingpage.nix +++ b/nixos/system/all/nginx-landingpage.nix @@ -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"; + } + ]; + } + ]; }; }; };