helm/modules/browser/qutebrowser.nix

52 lines
1.6 KiB
Nix
Raw Normal View History

# modules/browser/qutebrowser.nix --- https://github.com/qutebrowser/qutebrowser
#
# Qutebrowser is cute because it's not enough of a browser to be handsome.
# Still, we can all tell he'll grow up to be one hell of a lady-killer.
2020-01-03 21:13:46 -08:00
{ config, lib, pkgs, ... }:
{
my.packages = with pkgs; [
qutebrowser
(pkgs.writeScriptBin "qutebrowser-private" ''
#!${stdenv.shell}
${qutebrowser}/bin/qutebrowser ":open -p $@"
'')
(makeDesktopItem {
name = "qutebrowser-private";
desktopName = "Qutebrowser (Private)";
genericName = "Open a private Qutebrowser window";
icon = "qutebrowser";
exec = "${qutebrowser}/bin/qutebrowser ':open -p'";
categories = "Network";
})
];
2020-01-12 15:17:17 -08:00
my.env.BROWSER = "qutebrowser";
my.home.xdg = {
2020-01-03 21:13:46 -08:00
configFile."qutebrowser" = {
2020-01-17 01:22:50 -08:00
source = <config/qutebrowser>;
2020-01-03 21:13:46 -08:00
recursive = true;
};
dataFile = {
"qutebrowser/greasemonkey" = {
source = <config/qutebrowser/greasemonkey>;
recursive = true;
};
"qutebrowser/userstyles.css".source =
let compiledStyles =
with pkgs; runCommand "compileUserStyles"
{ buildInputs = [ sass ]; } ''
mkdir "$out"
for file in ${<config/qutebrowser/styles>}/*.scss; do
scss --sourcemap=none \
--no-cache \
--style compressed \
--default-encoding utf-8 \
"$file" \
>>"$out/userstyles.css"
done
'';
in "${compiledStyles}/userstyles.css";
2020-01-03 21:13:46 -08:00
};
};
}