about summary refs log tree commit diff
diff options
context:
space:
mode:
authorK900 <me@0upti.me>2024-05-05 22:07:26 +0300
committerK900 <me@0upti.me>2024-05-05 22:40:09 +0300
commit7408ffd912959e7f018d41dee9b830a906a49050 (patch)
treedff2c229997b611077daa2151141b68ffc5434eb
parent76b23b87569deff7e3efc984fe884905fd512ae6 (diff)
home-assistant-custom-lovelace-modules.valetudo-map-card: init at 2023.04.0
-rw-r--r--pkgs/servers/home-assistant/custom-lovelace-modules/default.nix2
-rw-r--r--pkgs/servers/home-assistant/custom-lovelace-modules/valetudo-map-card/default.nix39
-rw-r--r--pkgs/servers/home-assistant/custom-lovelace-modules/valetudo-map-card/remove-git-dependency.patch64
3 files changed, 105 insertions, 0 deletions
diff --git a/pkgs/servers/home-assistant/custom-lovelace-modules/default.nix b/pkgs/servers/home-assistant/custom-lovelace-modules/default.nix
index 54120bbbf917c..d2b16943a59ab 100644
--- a/pkgs/servers/home-assistant/custom-lovelace-modules/default.nix
+++ b/pkgs/servers/home-assistant/custom-lovelace-modules/default.nix
@@ -22,5 +22,7 @@
 
   mushroom = callPackage ./mushroom { };
 
+  valetudo-map-card = callPackage ./valetudo-map-card { };
+
   zigbee2mqtt-networkmap = callPackage ./zigbee2mqtt-networkmap { };
 }
diff --git a/pkgs/servers/home-assistant/custom-lovelace-modules/valetudo-map-card/default.nix b/pkgs/servers/home-assistant/custom-lovelace-modules/valetudo-map-card/default.nix
new file mode 100644
index 0000000000000..3203c59e7cd9f
--- /dev/null
+++ b/pkgs/servers/home-assistant/custom-lovelace-modules/valetudo-map-card/default.nix
@@ -0,0 +1,39 @@
+{ lib
+, buildNpmPackage
+, fetchFromGitHub
+}:
+
+buildNpmPackage rec {
+  pname = "lovelace-valetudo-map-card";
+  version = "2023.04.0";
+
+  src = fetchFromGitHub {
+    owner = "Hypfer";
+    repo = "lovelace-valetudo-map-card";
+    rev = "v${version}";
+    hash = "sha256-owOIbA1tRlnbWJ/p/wAUpeDnz/Wzu+GmUammJ6VFxHc=";
+  };
+
+  patches = [ ./remove-git-dependency.patch ];
+
+  npmDepsHash = "sha256-xHHbOt9HW+zJAhHEDy2V5eYyLv4e3OrUbnzqeJasSng=";
+
+  installPhase = ''
+    runHook preInstall
+
+    mkdir $out
+    cp dist/valetudo-map-card.js $out
+
+    runHook postInstall
+  '';
+
+  passthru.entrypoint = "valetudo-map-card.js";
+
+  meta = with lib; {
+    description = "Display the map from a valetudo-enabled robot in a home assistant dashboard card";
+    homepage = "https://github.com/Hypfer/lovelace-valetudo-map-card";
+    license = licenses.mit;
+    maintainers = with maintainers; [ k900 ];
+    platforms = platforms.all;
+  };
+}
diff --git a/pkgs/servers/home-assistant/custom-lovelace-modules/valetudo-map-card/remove-git-dependency.patch b/pkgs/servers/home-assistant/custom-lovelace-modules/valetudo-map-card/remove-git-dependency.patch
new file mode 100644
index 0000000000000..bedf4af3ac29a
--- /dev/null
+++ b/pkgs/servers/home-assistant/custom-lovelace-modules/valetudo-map-card/remove-git-dependency.patch
@@ -0,0 +1,64 @@
+diff --git a/package-lock.json b/package-lock.json
+index cce05ba..36020f8 100644
+--- a/package-lock.json
++++ b/package-lock.json
+@@ -1,12 +1,12 @@
+ {
+   "name": "lovelace-valetudo-map-card",
+-  "version": "2022.08.0",
++  "version": "2023.04.0",
+   "lockfileVersion": 2,
+   "requires": true,
+   "packages": {
+     "": {
+       "name": "lovelace-valetudo-map-card",
+-      "version": "2022.08.0",
++      "version": "2023.04.0",
+       "license": "MIT",
+       "dependencies": {
+         "custom-card-helpers": "1.9.0"
+@@ -21,7 +21,6 @@
+         "eslint-plugin-jsdoc": "39.3.0",
+         "eslint-plugin-regexp": "1.7.0",
+         "eslint-plugin-sort-keys-fix": "1.1.2",
+-        "eslint-plugin-sort-requires": "git+https://npm@github.com/Hypfer/eslint-plugin-sort-requires.git#2.1.1",
+         "pako": "2.0.4",
+         "rollup": "2.58.0",
+         "rollup-plugin-babel": "4.4.0",
+@@ -1596,12 +1595,6 @@
+         "node": ">=6.0.0"
+       }
+     },
+-    "node_modules/eslint-plugin-sort-requires": {
+-      "version": "2.1.0",
+-      "resolved": "git+https://npm@github.com/Hypfer/eslint-plugin-sort-requires.git#3e216dd9e9589b87671a3e7bf4084a0bd96e920e",
+-      "dev": true,
+-      "license": "MIT"
+-    },
+     "node_modules/eslint-scope": {
+       "version": "7.1.1",
+       "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.1.1.tgz",
+@@ -4358,11 +4351,6 @@
+         }
+       }
+     },
+-    "eslint-plugin-sort-requires": {
+-      "version": "git+https://npm@github.com/Hypfer/eslint-plugin-sort-requires.git#3e216dd9e9589b87671a3e7bf4084a0bd96e920e",
+-      "dev": true,
+-      "from": "eslint-plugin-sort-requires@git+https://npm@github.com/Hypfer/eslint-plugin-sort-requires.git#2.1.1"
+-    },
+     "eslint-scope": {
+       "version": "7.1.1",
+       "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.1.1.tgz",
+diff --git a/package.json b/package.json
+index 85a9d35..d8c6865 100644
+--- a/package.json
++++ b/package.json
+@@ -23,7 +23,6 @@
+     "eslint-plugin-jsdoc": "39.3.0",
+     "eslint-plugin-regexp": "1.7.0",
+     "eslint-plugin-sort-keys-fix": "1.1.2",
+-    "eslint-plugin-sort-requires": "git+https://npm@github.com/Hypfer/eslint-plugin-sort-requires.git#2.1.1",
+     "@typescript-eslint/eslint-plugin": "5.25.0",
+     "@typescript-eslint/experimental-utils": "5.25.0",
+     "@typescript-eslint/parser": "5.25.0",