qutebrowser: add greasemonkey userscript option
Co-authored-by: Ivar Scholten <ivar.scholten@protonmail.com>
This commit is contained in:
parent
54c1ca74d9
commit
3433206e51
3 changed files with 71 additions and 1 deletions
|
|
@ -1,5 +1,6 @@
|
|||
{
|
||||
qutebrowser-settings = ./settings.nix;
|
||||
qutebrowser-greasemonkey = ./greasemonkey.nix;
|
||||
qutebrowser-keybindings = ./keybindings.nix;
|
||||
qutebrowser-quickmarks = ./quickmarks.nix;
|
||||
qutebrowser-settings = ./settings.nix;
|
||||
}
|
||||
|
|
|
|||
34
tests/modules/programs/qutebrowser/greasemonkey.nix
Normal file
34
tests/modules/programs/qutebrowser/greasemonkey.nix
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
|
||||
greasemonkeyScript = pkgs.writeText "qutebrowser-greasemonkey.js" ''
|
||||
// ==UserScript==
|
||||
// @name foo
|
||||
// @namespace foo
|
||||
// @match https://example.com/*
|
||||
// @grant none
|
||||
// ==/UserScript==
|
||||
'';
|
||||
|
||||
in {
|
||||
programs.qutebrowser = {
|
||||
enable = true;
|
||||
greasemonkey = [ greasemonkeyScript ];
|
||||
};
|
||||
|
||||
test.stubs.qutebrowser = { };
|
||||
|
||||
nmt.script = let
|
||||
scriptDir = if pkgs.stdenv.hostPlatform.isDarwin then
|
||||
".qutebrowser/greasemonkey"
|
||||
else
|
||||
".config/qutebrowser/greasemonkey";
|
||||
in ''
|
||||
assertFileContent \
|
||||
home-files/${scriptDir}/qutebrowser-greasemonkey.js \
|
||||
${greasemonkeyScript}
|
||||
'';
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue