graphical#qutebrowser: init

The current qutebrowser configuration is sufficiently complex that it
benefits from being factored out into a separate subprofile. An
additional benefit is that this subprofile is now exported via the
`nixosModules` flake output.
This commit is contained in:
Timothy DeHerrera 2020-01-03 21:19:53 -07:00
parent 3e43465bc6
commit c2fa18a063
No known key found for this signature in database
GPG Key ID: 8985725DB5B0C122
5 changed files with 54 additions and 31 deletions

View File

@ -1,5 +1,7 @@
{ {
graphical = import ./graphical; graphical = import ./graphical;
sway = import ./graphical/sway;
qutebrowser = import ./graphical/qutebrowser;
develop = import ./develop; develop = import ./develop;
misc = import ./misc; misc = import ./misc;
games = import ./game; games = import ./game;

View File

@ -14,8 +14,6 @@ in
hardware.opengl.driSupport = true; hardware.opengl.driSupport = true;
hardware.pulseaudio.enable = true; hardware.pulseaudio.enable = true;
sound.enable = true;
environment = { environment = {
etc = { etc = {
"xdg/gtk-3.0/settings.ini" = { "xdg/gtk-3.0/settings.ini" = {
@ -27,22 +25,9 @@ in
''; '';
mode = "444"; mode = "444";
}; };
"xdg/qutebrowser/config.py".text = let
mpv = "${pkgs.mpv}/bin/mpv";
in
''
${readFile ./qutebrowser/config.py}
config.bind(',m', 'hint links spawn -d ${mpv} {hint-url}')
config.bind(',v', 'spawn -d ${mpv} {url}')
'';
}; };
sessionVariables = { sessionVariables = {
# default browser
BROWSER = "qute";
# Theme settings # Theme settings
QT_QPA_PLATFORMTHEME = "gtk2"; QT_QPA_PLATFORMTHEME = "gtk2";
GTK2_RC_FILES = let GTK2_RC_FILES = let
@ -71,13 +56,8 @@ in
imlib2 imlib2
librsvg librsvg
libsForQt5.qtstyleplugins libsForQt5.qtstyleplugins
mpv
networkmanager_dmenu
papirus-icon-theme papirus-icon-theme
qute
qutebrowser
sddm-chili sddm-chili
youtubeDL
zathura zathura
]; ];
}; };
@ -94,22 +74,18 @@ in
}; };
nixpkgs.overlays = let nixpkgs.overlays = let
overlay = self: super: { overlay = final: prev: {
qute = super.writeShellScriptBin "qute" '' cursor = prev.writeTextDir "share/icons/default/index.theme" ''
exec ${super.qutebrowser}/bin/qutebrowser -C /etc/xdg/qutebrowser/config.py "$@"
'';
cursor = super.writeTextDir "share/icons/default/index.theme" ''
[icon theme] [icon theme]
Inherits=Adwaita Inherits=Adwaita
''; '';
ffmpeg-full = super.ffmpeg-full.override { ffmpeg-full = prev.ffmpeg-full.override {
svt-av1 = super.svt-av1; svt-av1 = prev.svt-av1;
dav1d = super.dav1d; dav1d = prev.dav1d;
libaom = null; libaom = null;
opencore-amr = null; opencore-amr = null;
libopus = super.libopus; libopus = prev.libopus;
}; };
}; };
in in

View File

@ -0,0 +1,37 @@
{ pkgs, ... }:
let
inherit (builtins) readFile;
in
{
sound.enable = true;
environment = {
etc."xdg/qutebrowser/config.py".text = let
mpv = "${pkgs.mpv}/bin/mpv";
in
''
${readFile ./config.py}
config.bind(',m', 'hint links spawn -d ${mpv} {hint-url}')
config.bind(',v', 'spawn -d ${mpv} {url}')
'';
sessionVariables.BROWSER = "qute";
systemPackages = with pkgs; [
qute
qutebrowser
mpv
youtubeDL
];
};
nixpkgs.overlays = let
overlay = final: prev: {
qute = prev.writeShellScriptBin "qute" ''
exec ${prev.qutebrowser}/bin/qutebrowser -C /etc/xdg/qutebrowser/config.py "$@"
'';
};
in
[ overlay ];
}

View File

@ -11,7 +11,7 @@ set $right l
set $term alacritty set $term alacritty
# preferred browser # preferred browser
set $browser qute set $browser $$BROWSER
# Your preferred application launcher # Your preferred application launcher
# Note: it's recommended that you pass the final command to sway # Note: it's recommended that you pass the final command to sway

View File

@ -9,6 +9,12 @@ let
; ;
in in
{ {
imports = [
../qutebrowser
];
sound.enable = true;
programs.sway = { programs.sway = {
enable = true; enable = true;
@ -24,6 +30,8 @@ in
extraPackages = with pkgs; options.programs.sway.extraPackages.default extraPackages = with pkgs; options.programs.sway.extraPackages.default
++ [ ++ [
dmenu
networkmanager_dmenu
qt5.qtwayland qt5.qtwayland
alacritty alacritty
volnoti volnoti