about summary refs log tree commit diff
path: root/pkgs/servers/home-assistant/custom-lovelace-modules/android-tv-card
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/servers/home-assistant/custom-lovelace-modules/android-tv-card')
-rw-r--r--pkgs/servers/home-assistant/custom-lovelace-modules/android-tv-card/default.nix39
-rw-r--r--pkgs/servers/home-assistant/custom-lovelace-modules/android-tv-card/dont-call-git.patch17
2 files changed, 56 insertions, 0 deletions
diff --git a/pkgs/servers/home-assistant/custom-lovelace-modules/android-tv-card/default.nix b/pkgs/servers/home-assistant/custom-lovelace-modules/android-tv-card/default.nix
new file mode 100644
index 0000000000000..9398e57486f99
--- /dev/null
+++ b/pkgs/servers/home-assistant/custom-lovelace-modules/android-tv-card/default.nix
@@ -0,0 +1,39 @@
+{ lib
+, buildNpmPackage
+, fetchFromGitHub
+}:
+
+buildNpmPackage rec {
+  pname = "android-tv-card";
+  version = "3.8.1";
+
+  src = fetchFromGitHub {
+    owner = "Nerwyn";
+    repo = "android-tv-card";
+    rev = version;
+    hash = "sha256-ARFJJ119zJzjW0d59JFARMcjVAJ2IFDkShIN43d1adI=";
+  };
+
+  patches = [ ./dont-call-git.patch ];
+
+  npmDepsHash = "sha256-t/kZTcXs3IpbrEfnmYQlJqhM8F3mO4prbQNnKtFqsDM=";
+
+  installPhase = ''
+    runHook preInstall
+
+    mkdir $out
+    cp dist/android-tv-card.min.js $out
+
+    runHook postInstall
+  '';
+
+  passthru.entrypoint = "android-tv-card.min.js";
+
+  meta = with lib; {
+    description = "Universal Customizable TV Remote Card, with HA actions, super configurable touchpad, slider, haptics, and keyboard";
+    homepage = "https://github.com/Nerwyn/android-tv-card";
+    license = licenses.asl20;
+    maintainers = with maintainers; [ k900 ];
+    platforms = platforms.all;
+  };
+}
diff --git a/pkgs/servers/home-assistant/custom-lovelace-modules/android-tv-card/dont-call-git.patch b/pkgs/servers/home-assistant/custom-lovelace-modules/android-tv-card/dont-call-git.patch
new file mode 100644
index 0000000000000..ad409a30dc261
--- /dev/null
+++ b/pkgs/servers/home-assistant/custom-lovelace-modules/android-tv-card/dont-call-git.patch
@@ -0,0 +1,17 @@
+diff --git a/webpack.config.js b/webpack.config.js
+index 469ffe1..3233c4b 100644
+--- a/webpack.config.js
++++ b/webpack.config.js
+@@ -1,11 +1,7 @@
+ const path = require('path');
+ const { execSync } = require('child_process');
+ 
+-let env =
+-	execSync('git branch --show-current').toString().trim() == 'main'
+-		? 'production'
+-		: 'development';
+-env = 'production';
++let env = 'production';
+ 
+ module.exports = {
+ 	mode: env,