From c2fa18a063caf573463c47e00025b396033586e7 Mon Sep 17 00:00:00 2001 From: Timothy DeHerrera Date: Fri, 3 Jan 2020 21:19:53 -0700 Subject: [PATCH] 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. --- profiles/default.nix | 2 ++ profiles/graphical/default.nix | 36 ++++----------------- profiles/graphical/qutebrowser/default.nix | 37 ++++++++++++++++++++++ profiles/graphical/sway/config | 2 +- profiles/graphical/sway/default.nix | 8 +++++ 5 files changed, 54 insertions(+), 31 deletions(-) create mode 100644 profiles/graphical/qutebrowser/default.nix diff --git a/profiles/default.nix b/profiles/default.nix index 8430793b..d9c2f3a7 100644 --- a/profiles/default.nix +++ b/profiles/default.nix @@ -1,5 +1,7 @@ { graphical = import ./graphical; + sway = import ./graphical/sway; + qutebrowser = import ./graphical/qutebrowser; develop = import ./develop; misc = import ./misc; games = import ./game; diff --git a/profiles/graphical/default.nix b/profiles/graphical/default.nix index e52ca795..e4410eb4 100644 --- a/profiles/graphical/default.nix +++ b/profiles/graphical/default.nix @@ -14,8 +14,6 @@ in hardware.opengl.driSupport = true; hardware.pulseaudio.enable = true; - sound.enable = true; - environment = { etc = { "xdg/gtk-3.0/settings.ini" = { @@ -27,22 +25,9 @@ in ''; 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 = { - # default browser - BROWSER = "qute"; - # Theme settings QT_QPA_PLATFORMTHEME = "gtk2"; GTK2_RC_FILES = let @@ -71,13 +56,8 @@ in imlib2 librsvg libsForQt5.qtstyleplugins - mpv - networkmanager_dmenu papirus-icon-theme - qute - qutebrowser sddm-chili - youtubeDL zathura ]; }; @@ -94,22 +74,18 @@ in }; nixpkgs.overlays = let - overlay = self: super: { - qute = super.writeShellScriptBin "qute" '' - exec ${super.qutebrowser}/bin/qutebrowser -C /etc/xdg/qutebrowser/config.py "$@" - ''; - - cursor = super.writeTextDir "share/icons/default/index.theme" '' + overlay = final: prev: { + cursor = prev.writeTextDir "share/icons/default/index.theme" '' [icon theme] Inherits=Adwaita ''; - ffmpeg-full = super.ffmpeg-full.override { - svt-av1 = super.svt-av1; - dav1d = super.dav1d; + ffmpeg-full = prev.ffmpeg-full.override { + svt-av1 = prev.svt-av1; + dav1d = prev.dav1d; libaom = null; opencore-amr = null; - libopus = super.libopus; + libopus = prev.libopus; }; }; in diff --git a/profiles/graphical/qutebrowser/default.nix b/profiles/graphical/qutebrowser/default.nix new file mode 100644 index 00000000..ea322ff9 --- /dev/null +++ b/profiles/graphical/qutebrowser/default.nix @@ -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 ]; +} diff --git a/profiles/graphical/sway/config b/profiles/graphical/sway/config index 432c264a..3d2ea92c 100644 --- a/profiles/graphical/sway/config +++ b/profiles/graphical/sway/config @@ -11,7 +11,7 @@ set $right l set $term alacritty # preferred browser -set $browser qute +set $browser $$BROWSER # Your preferred application launcher # Note: it's recommended that you pass the final command to sway diff --git a/profiles/graphical/sway/default.nix b/profiles/graphical/sway/default.nix index 5356baba..85690429 100644 --- a/profiles/graphical/sway/default.nix +++ b/profiles/graphical/sway/default.nix @@ -9,6 +9,12 @@ let ; in { + imports = [ + ../qutebrowser + ]; + + sound.enable = true; + programs.sway = { enable = true; @@ -24,6 +30,8 @@ in extraPackages = with pkgs; options.programs.sway.extraPackages.default ++ [ + dmenu + networkmanager_dmenu qt5.qtwayland alacritty volnoti