about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorSoispha <soispha@vhack.eu>2023-10-21 22:52:55 +0200
committerSoispha <soispha@vhack.eu>2023-10-21 23:13:51 +0200
commitc99677e9cbc3b9ff7b499d74c5d7c17042ab3b30 (patch)
tree4aefbf97baac0c2f06ea0c22d7ec47e1804af911
parentfeat(hm/conf/firefox): Use the policy.json file for configs (diff)
downloadnixos-config-c99677e9cbc3b9ff7b499d74c5d7c17042ab3b30.tar.gz
nixos-config-c99677e9cbc3b9ff7b499d74c5d7c17042ab3b30.zip
fix(hm/conf/firefox/conf/exts/nmh): Spell 'messaging' correctly
-rw-r--r--hm/soispha/conf/firefox/config/extensions/native_messaging_hosts/default.nix4
-rw-r--r--hm/soispha/conf/firefox/config/extensions/native_messaging_hosts/video-pauser.nix14
-rw-r--r--hm/soispha/conf/firefox/default.nix2
-rw-r--r--hm/soispha/conf/firefox/package.nix5
4 files changed, 10 insertions, 15 deletions
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 053b6465..14f4e257 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
@@ -16,10 +16,6 @@ in
   ++ lib.optional (cfg.enableKeePassXC or false) keepassxc
 
 
-  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
   */
   with pkgs; [
     video_pause_ext
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
index a652b596..0c2c5155 100644
--- 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
@@ -14,9 +14,9 @@ in
   */
   pkgs.stdenv.mkDerivation {
     inherit (video-pauser) pname version;
-    buildInputs = [
-      video_pause
-    ];
+
+    # FIXME: Don't use the deprecated 'phases' here <2023-10-21>
+    phases = ["buildPhase"];
     buildPhase = ''
       mkdir -p $out/share/
       cat << EOF > $out/share/"${video-pauser.pname}".json
@@ -29,18 +29,18 @@ in
       }
       EOF
 
-      nativeMessagingPaths="$(cat << 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
-      )"
 
-      cat "$nativeMessagingPaths" | while read -r path; do
+      while read -r path; do
         mkdir -p $out/$path;
         cp $out/share/"${video-pauser.pname}".json $out/$path/
-      done
+      done < "$nmp"
     '';
   }
diff --git a/hm/soispha/conf/firefox/default.nix b/hm/soispha/conf/firefox/default.nix
index 7ebcbbb4..15300c0f 100644
--- a/hm/soispha/conf/firefox/default.nix
+++ b/hm/soispha/conf/firefox/default.nix
@@ -19,7 +19,7 @@
   };
   engines = (import ./config/search/engines) {inherit pkgs;};
 
-  native_messaging_hosts = (import ./config/extensions/native_messaging_hosts) {inherit pkgs video_pause;};
+  native_messaging_hosts = (import ./config/extensions/native_messaging_hosts/default.nix) {inherit pkgs video_pause;};
 
   policies = (import ./config/policies) {inherit config extensions;};
 
diff --git a/hm/soispha/conf/firefox/package.nix b/hm/soispha/conf/firefox/package.nix
index 8f9d09c0..f38c8bbe 100644
--- a/hm/soispha/conf/firefox/package.nix
+++ b/hm/soispha/conf/firefox/package.nix
@@ -5,11 +5,10 @@
   pkgs,
   # options
   autoConfig ? "",
-  extraNativeMassagingHosts ? [],
+  extraNativeMessagingHosts ? [],
   wrapperConfig ? {},
   extraPolicies ? {},
   base_package ? pkgs.firefox,
-  ...
 }: let
   pkg = base_package.override (old: {
     inherit extraPolicies;
@@ -17,7 +16,7 @@
     extraNativeMessagingHosts =
       old.extraNativeMessagingHosts
       or []
-      ++ extraNativeMassagingHosts;
+      ++ extraNativeMessagingHosts;
     cfg = let
       # copy-pasted from the wrapper; TODO: figure out fix
       applicationName = base_package.binaryName or (lib.getName base_package);