From c33b1777b6098f999cc4f099424056554dc7f035 Mon Sep 17 00:00:00 2001 From: jD91mZM2 Date: Mon, 18 Jan 2021 23:15:34 +0100 Subject: [PATCH] chromium: fix preinstallation of crx files We currently check `isPath` and `isString` on crxPath and version respectively, which is 1. pointless because the module system already does such checks, and 2. wrong because isPath means path literal; a derivation therefore is not a path. --- modules/programs/chromium.nix | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/modules/programs/chromium.nix b/modules/programs/chromium.nix index 07c4542e..a3860257 100644 --- a/modules/programs/chromium.nix +++ b/modules/programs/chromium.nix @@ -116,15 +116,15 @@ let "${config.xdg.configHome}/${browser}"; extensionJson = ext: + assert ext.crxPath != null -> ext.version != null; with builtins; { name = "${configDir}/External Extensions/${ext.id}.json"; - value.text = toJSON - (if (isPath ext.crxPath && isString ext.version) then { - external_crx = ext.crxPath; - external_version = ext.version; - } else { - external_update_url = ext.updateUrl; - }); + value.text = toJSON (if ext.crxPath != null then { + external_crx = ext.crxPath; + external_version = ext.version; + } else { + external_update_url = ext.updateUrl; + }); }; in mkIf cfg.enable {