depot/third_party/home-manager/tests/modules/programs/qutebrowser/greasemonkey.nix
Default email c6444ecc3c Project import generated by Copybara.
GitOrigin-RevId: 51e44a13acea71b36245e8bd8c7db53e0a3e61ee
2024-01-05 12:06:15 +01:00

34 lines
706 B
Nix

{ 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}
'';
}