From 329d3e51acc5ec9fe5fc671bd8a2107e0a3ef2d8 Mon Sep 17 00:00:00 2001 From: Soispha Date: Tue, 24 Oct 2023 14:01:18 +0200 Subject: fix(hm/conf/firefox/extensions/nmh): Fully rename to video pause --- .../extensions/native_messaging_hosts/default.nix | 2 +- .../native_messaging_hosts/video-pause.nix | 45 ++++++++++++++++++++++ .../native_messaging_hosts/video-pauser.nix | 45 ---------------------- 3 files changed, 46 insertions(+), 46 deletions(-) create mode 100644 hm/soispha/conf/firefox/config/extensions/native_messaging_hosts/video-pause.nix delete mode 100644 hm/soispha/conf/firefox/config/extensions/native_messaging_hosts/video-pauser.nix diff --git a/hm/soispha/conf/firefox/config/extensions/native_messaging_hosts/default.nix b/hm/soispha/conf/firefox/config/extensions/native_messaging_hosts/default.nix index 14f4e257..e0ee1dfa 100644 --- a/hm/soispha/conf/firefox/config/extensions/native_messaging_hosts/default.nix +++ b/hm/soispha/conf/firefox/config/extensions/native_messaging_hosts/default.nix @@ -3,7 +3,7 @@ video_pause, ... }: let - video_pause_ext = import ./video-pauser.nix {inherit pkgs video_pause;}; + video_pause_ext = import ./video-pause.nix {inherit pkgs video_pause;}; in /* ++ lib.optional (cfg.enableBrowserpass or false) (lib.getBin browserpass) diff --git a/hm/soispha/conf/firefox/config/extensions/native_messaging_hosts/video-pause.nix b/hm/soispha/conf/firefox/config/extensions/native_messaging_hosts/video-pause.nix new file mode 100644 index 00000000..2802dfbf --- /dev/null +++ b/hm/soispha/conf/firefox/config/extensions/native_messaging_hosts/video-pause.nix @@ -0,0 +1,45 @@ +{ + pkgs, + video_pause, + ... +}: let + extensions = builtins.fromJSON (builtins.readFile ../extensions.json); + inherit (extensions) video-pause; +in + /* + mkdir -p $out/lib/mozilla/native-messaging-hosts + for ext in ${toString nativeMessagingHosts}; do + ln -sLt $out/lib/mozilla/native-messaging-hosts $ext/lib/mozilla/native-messaging-hosts/* + done + */ + pkgs.stdenv.mkDerivation { + inherit (video-pause) pname version; + + dontUnpack = true; + buildPhase = '' + mkdir -p $out/share/ + cat << EOF > $out/share/"${video-pause.pname}".json + { + "name": "${video-pause.pname}", + "description": "Stop a video with a native hotkey", + "path": "${video_pause}/bin/video-pause", + "type": "stdio", + "allowed_extensions": ["${video-pause.addonId}"] + } + EOF + + nmp="$(mktemp)"; + cat << EOF > "$nmp" + lib/mozilla/native-messaging-hosts + lib/librewolf/native-messaging-hosts + etc/opt/chrome/native-messaging-hosts + etc/chromium/native-messaging-hosts + etc/vivaldi/native-messaging-hosts + EOF + + while read -r path; do + mkdir -p $out/$path; + cp $out/share/"${video-pause.pname}".json $out/$path/ + done < "$nmp" + ''; + } diff --git a/hm/soispha/conf/firefox/config/extensions/native_messaging_hosts/video-pauser.nix b/hm/soispha/conf/firefox/config/extensions/native_messaging_hosts/video-pauser.nix deleted file mode 100644 index b3f357e9..00000000 --- a/hm/soispha/conf/firefox/config/extensions/native_messaging_hosts/video-pauser.nix +++ /dev/null @@ -1,45 +0,0 @@ -{ - pkgs, - video_pause, - ... -}: let - extensions = builtins.fromJSON (builtins.readFile ../extensions.json); - inherit (extensions) video-pauser; -in - /* - mkdir -p $out/lib/mozilla/native-messaging-hosts - for ext in ${toString nativeMessagingHosts}; do - ln -sLt $out/lib/mozilla/native-messaging-hosts $ext/lib/mozilla/native-messaging-hosts/* - done - */ - pkgs.stdenv.mkDerivation { - inherit (video-pauser) pname version; - - dontUnpack = true; - buildPhase = '' - mkdir -p $out/share/ - cat << EOF > $out/share/"${video-pauser.pname}".json - { - "name": "${video-pauser.pname}", - "description": "Stop a video with a native hotkey", - "path": "${video_pause}/bin/video_pause", - "type": "stdio", - "allowed_extensions": ["${video-pauser.addonId}"] - } - EOF - - nmp="$(mktemp)"; - cat << EOF > "$nmp" - lib/mozilla/native-messaging-hosts - lib/librewolf/native-messaging-hosts - etc/opt/chrome/native-messaging-hosts - etc/chromium/native-messaging-hosts - etc/vivaldi/native-messaging-hosts - EOF - - while read -r path; do - mkdir -p $out/$path; - cp $out/share/"${video-pauser.pname}".json $out/$path/ - done < "$nmp" - ''; - } -- cgit 1.4.1