diff --git a/flake.lock b/flake.lock index ee03bd2..49cad51 100644 --- a/flake.lock +++ b/flake.lock @@ -334,11 +334,11 @@ }, "nixos-hardware": { "locked": { - "lastModified": 1704458188, - "narHash": "sha256-f6BYEuIqnbrs6J/9m1/1VdkJ6d63hO9kUC09kTPuOqE=", + "lastModified": 1704632650, + "narHash": "sha256-83J/nd/NoLqo3vj0S0Ppqe8L+ijIFiGL6HNDfCCUD/Q=", "owner": "NixOS", "repo": "nixos-hardware", - "rev": "172385318068519900a7d71c1024242fa6af75f0", + "rev": "c478b3d56969006e015e55aaece4931f3600c1b2", "type": "github" }, "original": { diff --git a/hm/common.nix b/hm/common.nix index 9919561..39f3832 100644 --- a/hm/common.nix +++ b/hm/common.nix @@ -63,8 +63,11 @@ in # TODO Maybe we can do something about node-gyp ]; commonShellAliases = { - # Completion for existing commands + # Replacement commands ls = "lsd"; + cat = "bat -pp"; + + # Completion for existing commands mkdir = "mkdir -v"; # cp = "cp -i"; # Disabled because conflicts with the ZSH/Bash one. This separation is confusing I swear. mv = "mv -iv"; @@ -76,6 +79,7 @@ in numbat = "numbat --intro-banner off"; insect = "numbat"; ipython = "ipython --no-confirm-exit --pdb"; + bat = "bat -A"; # Frequent mistakes sl = "ls"; @@ -525,7 +529,6 @@ in } // lib.optionalAttrs config.frogeye.desktop.xorg { # Favourite commands VISUAL = "nvim"; - BROWSER = "${config.programs.qutebrowser.package}/bin/qutebrowser"; # Extra config RXVT_SOCKET = "${config.xdg.stateHome}/urxvtd"; # Used to want -$HOME suffix, hopefullt this isn't needed diff --git a/hm/default.nix b/hm/default.nix index ccf8775..978ddc0 100644 --- a/hm/default.nix +++ b/hm/default.nix @@ -3,7 +3,7 @@ imports = [ ../options.nix ./common.nix - ./desktop.nix + ./desktop ./dev.nix ./extra.nix ./gaming diff --git a/hm/batteryNotify.sh b/hm/desktop/batteryNotify.sh similarity index 100% rename from hm/batteryNotify.sh rename to hm/desktop/batteryNotify.sh diff --git a/hm/desktop.nix b/hm/desktop/default.nix similarity index 89% rename from hm/desktop.nix rename to hm/desktop/default.nix index 1ca0467..fc684d0 100644 --- a/hm/desktop.nix +++ b/hm/desktop/default.nix @@ -6,6 +6,7 @@ in { imports = [ ./frobar + ./qutebrowser.nix ]; config = lib.mkIf config.frogeye.desktop.xorg { frogeye.shellAliases = { @@ -129,8 +130,6 @@ in }"; "${mod}+Shift+Return" = "exec ${config.programs.urxvt.package}/bin/urxvt"; "${mod}+p" = "exec ${pkgs.xfce.thunar}/bin/thunar"; - "${mod}+m" = "exec ${config.programs.qutebrowser.package}/bin/qutebrowser --override-restore --backend=webengine"; - # TODO --backend not useful anymore # Volume control "XF86AudioRaiseVolume" = "${pactl} set-sink-mute @DEFAULT_SINK@ false; ${pactl} set-sink-volume @DEFAULT_SINK@ +5%"; "XF86AudioLowerVolume" = "${pactl} set-sink-mute @DEFAULT_SINK@ false; ${pactl} set-sink-volume @DEFAULT_SINK@ -5%"; @@ -310,8 +309,6 @@ in titlebar = false; # So that single-container screens are basically almost fullscreen commands = [ # Open specific applications in floating mode - { criteria = { class = "Firefox"; }; command = "layout tabbed"; } # Doesn't seem to work anymore - { criteria = { class = "qutebrowser"; }; command = "layout tabbed"; } { criteria = { title = "^pdfpc.*"; window_role = "presenter"; }; command = "move to output left, fullscreen"; } { criteria = { title = "^pdfpc.*"; window_role = "presentation"; }; command = "move to output right, fullscreen"; } # switch to workspace with urgent window automatically @@ -356,79 +353,6 @@ in }; programs = { - # Browser - qutebrowser = { - enable = true; - keyBindings = { - normal = { - # Match tab behaviour to i3. Not that I use them. - "H" = "tab-prev"; - "J" = "back"; - "K" = "forward"; - "L" = "tab-next"; - # "T" = null; - "af" = "spawn --userscript freshrss"; # TODO Broken? - "as" = "spawn --userscript shaarli"; # TODO I don't use shaarli anymore - # "d" = null; - "u" = "undo --window"; - # TODO Unbind d and T (?) - }; - }; - loadAutoconfig = true; - searchEngines = rec { - DEFAULT = ecosia; - alpinep = "https://pkgs.alpinelinux.org/packages?name={}&branch=edge"; - ampwhat = "http://www.amp-what.com/unicode/search/{}"; - arch = "https://wiki.archlinux.org/?search={}"; - archp = "https://www.archlinux.org/packages/?q={}"; - aur = "https://aur.archlinux.org/packages/?K={}"; - aw = ampwhat; - ddg = duckduckgo; - dockerhub = "https://hub.docker.com/search/?isAutomated=0&isOfficial=0&page=1&pullCount=0&q={}&starCount=0"; - duckduckgo = "https://duckduckgo.com/?q={}&ia=web"; - ecosia = "https://www.ecosia.org/search?q={}"; - gfr = "https://www.google.fr/search?hl=fr&q={}"; - g = google; - gh = github; - gi = "http://images.google.com/search?q={}"; - giphy = "https://giphy.com/search/{}"; - github = "https://github.com/search?q={}"; - google = "https://www.google.fr/search?q={}"; - invidious = "https://invidious.frogeye.fr/search?q={}"; - inv = invidious; - npm = "https://www.npmjs.com/search?q={}"; - q = qwant; - qwant = "https://www.qwant.com/?t=web&q={}"; - wolfram = "https://www.wolframalpha.com/input/?i={}"; - youtube = "https://www.youtube.com/results?search_query={}"; - yt = youtube; - }; - settings = { - downloads.location.prompt = false; - tabs = { - show = "never"; - tabs_are_windows = true; - }; - url = rec { - open_base_url = true; - start_pages = lib.mkDefault "https://geoffrey.frogeye.fr/blank.html"; - default_page = start_pages; - }; - content = { - # I had this setting below, not sure if it did something special - # config.set("content.cookies.accept", "no-3rdparty", "chrome://*/*") - cookies.accept = "no-3rdparty"; - prefers_reduced_motion = true; - headers.accept_language = "fr-FR, fr;q=0.9, en-GB;q=0.8, en-US;q=0.7, en;q=0.6"; - tls.certificate_errors = "ask-block-thirdparty"; - }; - editor.command = [ "${pkgs.neovide}/bin/neovide" "--" "-f" "{file}" "-c" "normal {line}G{column0}l" ]; - # TODO Doesn't work on Arch. Does it even load the right profile on Nix? - # TODO spellcheck.languages = ["fr-FR" "en-GB" "en-US"]; - - }; - }; - # Terminal alacritty = { # TODO Emojis. Or maybe they work on NixOS? @@ -540,16 +464,6 @@ in }; xdg = { - mimeApps = { - enable = true; - defaultApplications = { - "text/html" = "org.qutebrowser.qutebrowser.desktop"; - "x-scheme-handler/http" = "org.qutebrowser.qutebrowser.desktop"; - "x-scheme-handler/https" = "org.qutebrowser.qutebrowser.desktop"; - "x-scheme-handler/about" = "org.qutebrowser.qutebrowser.desktop"; - "x-scheme-handler/unknown" = "org.qutebrowser.qutebrowser.desktop"; - }; - }; userDirs = { enable = true; # TODO Which ones do we want? createDirectories = true; diff --git a/hm/face.svg b/hm/desktop/face.svg similarity index 100% rename from hm/face.svg rename to hm/desktop/face.svg diff --git a/hm/frobar/.dev/barng.py b/hm/desktop/frobar/.dev/barng.py similarity index 100% rename from hm/frobar/.dev/barng.py rename to hm/desktop/frobar/.dev/barng.py diff --git a/hm/frobar/.dev/oldbar.py b/hm/desktop/frobar/.dev/oldbar.py similarity index 100% rename from hm/frobar/.dev/oldbar.py rename to hm/desktop/frobar/.dev/oldbar.py diff --git a/hm/frobar/.dev/pip.py b/hm/desktop/frobar/.dev/pip.py similarity index 100% rename from hm/frobar/.dev/pip.py rename to hm/desktop/frobar/.dev/pip.py diff --git a/hm/frobar/.dev/x.py b/hm/desktop/frobar/.dev/x.py similarity index 100% rename from hm/frobar/.dev/x.py rename to hm/desktop/frobar/.dev/x.py diff --git a/hm/frobar/.gitignore b/hm/desktop/frobar/.gitignore similarity index 100% rename from hm/frobar/.gitignore rename to hm/desktop/frobar/.gitignore diff --git a/hm/frobar/default.nix b/hm/desktop/frobar/default.nix similarity index 100% rename from hm/frobar/default.nix rename to hm/desktop/frobar/default.nix diff --git a/hm/frobar/frobar/__init__.py b/hm/desktop/frobar/frobar/__init__.py similarity index 100% rename from hm/frobar/frobar/__init__.py rename to hm/desktop/frobar/frobar/__init__.py diff --git a/hm/frobar/frobar/display.py b/hm/desktop/frobar/frobar/display.py similarity index 100% rename from hm/frobar/frobar/display.py rename to hm/desktop/frobar/frobar/display.py diff --git a/hm/frobar/frobar/notbusy.py b/hm/desktop/frobar/frobar/notbusy.py similarity index 100% rename from hm/frobar/frobar/notbusy.py rename to hm/desktop/frobar/frobar/notbusy.py diff --git a/hm/frobar/frobar/providers.py b/hm/desktop/frobar/frobar/providers.py similarity index 100% rename from hm/frobar/frobar/providers.py rename to hm/desktop/frobar/frobar/providers.py diff --git a/hm/frobar/frobar/updaters.py b/hm/desktop/frobar/frobar/updaters.py similarity index 100% rename from hm/frobar/frobar/updaters.py rename to hm/desktop/frobar/frobar/updaters.py diff --git a/hm/frobar/setup.py b/hm/desktop/frobar/setup.py similarity index 100% rename from hm/frobar/setup.py rename to hm/desktop/frobar/setup.py diff --git a/hm/desktop/qutebrowser.nix b/hm/desktop/qutebrowser.nix new file mode 100644 index 0000000..b8db821 --- /dev/null +++ b/hm/desktop/qutebrowser.nix @@ -0,0 +1,91 @@ +{ pkgs, lib, config, ... }: +{ + config = lib.mkIf config.frogeye.desktop.xorg { + home.sessionVariables = { + BROWSER = "qutebrowser"; + }; + programs.qutebrowser = { + enable = true; + keyBindings = { + normal = { + # Match tab behaviour to i3. Not that I use tabs. + "H" = "tab-prev"; + "J" = "back"; + "K" = "forward"; + "L" = "tab-next"; + # "T" = null; + "af" = "spawn --userscript freshrss"; # TODO Broken? + "as" = "spawn --userscript shaarli"; # TODO I don't use shaarli anymore + # "d" = null; + "u" = "undo --window"; + # TODO Unbind d and T (?) + }; + }; + loadAutoconfig = true; + searchEngines = rec { + DEFAULT = ecosia; + alpinep = "https://pkgs.alpinelinux.org/packages?name={}&branch=edge"; + ampwhat = "http://www.amp-what.com/unicode/search/{}"; + arch = "https://wiki.archlinux.org/?search={}"; + archp = "https://www.archlinux.org/packages/?q={}"; + aur = "https://aur.archlinux.org/packages/?K={}"; + aw = ampwhat; + ddg = duckduckgo; + dockerhub = "https://hub.docker.com/search/?isAutomated=0&isOfficial=0&page=1&pullCount=0&q={}&starCount=0"; + duckduckgo = "https://duckduckgo.com/?q={}&ia=web"; + ecosia = "https://www.ecosia.org/search?q={}"; + gfr = "https://www.google.fr/search?hl=fr&q={}"; + g = google; + gh = github; + gi = "http://images.google.com/search?q={}"; + giphy = "https://giphy.com/search/{}"; + github = "https://github.com/search?q={}"; + google = "https://www.google.fr/search?q={}"; + invidious = "https://invidious.frogeye.fr/search?q={}"; + inv = invidious; + npm = "https://www.npmjs.com/search?q={}"; + q = qwant; + qwant = "https://www.qwant.com/?t=web&q={}"; + wolfram = "https://www.wolframalpha.com/input/?i={}"; + youtube = "https://www.youtube.com/results?search_query={}"; + yt = youtube; + }; + settings = { + downloads.location.prompt = false; + tabs = { + show = "never"; + tabs_are_windows = true; + }; + url = rec { + open_base_url = true; + start_pages = lib.mkDefault "https://geoffrey.frogeye.fr/blank.html"; + default_page = start_pages; + }; + content = { + # I had this setting below, not sure if it did something special + # config.set("content.cookies.accept", "no-3rdparty", "chrome://*/*") + cookies.accept = "no-3rdparty"; + prefers_reduced_motion = true; + headers.accept_language = "fr-FR, fr;q=0.9, en-GB;q=0.8, en-US;q=0.7, en;q=0.6"; + tls.certificate_errors = "ask-block-thirdparty"; + }; + editor.command = [ "${pkgs.neovide}/bin/neovide" "--" "-f" "{file}" "-c" "normal {line}G{column0}l" ]; + # TODO Doesn't work on Arch. Does it even load the right profile on Nix? + # TODO spellcheck.languages = ["fr-FR" "en-GB" "en-US"]; + }; + }; + xdg.mimeApps = { + enable = true; + defaultApplications = { + "text/html" = "org.qutebrowser.qutebrowser.desktop"; + "x-scheme-handler/http" = "org.qutebrowser.qutebrowser.desktop"; + "x-scheme-handler/https" = "org.qutebrowser.qutebrowser.desktop"; + "x-scheme-handler/about" = "org.qutebrowser.qutebrowser.desktop"; + "x-scheme-handler/unknown" = "org.qutebrowser.qutebrowser.desktop"; + }; + }; + xsession.windowManager.i3.config.keybindings = { + "${config.xsession.windowManager.i3.config.modifier}+m" = "exec ${config.programs.qutebrowser.package}/bin/qutebrowser --override-restore"; + }; + }; +} diff --git a/hm/rebuild/default.nix b/hm/rebuild/default.nix index 3c0751c..70ab94f 100644 --- a/hm/rebuild/default.nix +++ b/hm/rebuild/default.nix @@ -7,7 +7,6 @@ in home.packages = [ (pkgs.writeShellApplication { name = "rb"; - runtimeInputs = [ pkgs.brightnessctl ]; text = '' verb="switch" if [ "$#" -ge 1 ] diff --git a/hm/rebuild/update-local-flakes.py b/hm/rebuild/update-local-flakes.py index d009105..03781a8 100755 --- a/hm/rebuild/update-local-flakes.py +++ b/hm/rebuild/update-local-flakes.py @@ -26,7 +26,8 @@ def process_flake(flake: str) -> None: dep_url = dep["url"] # if not local path, continue if not ( - dep_url.startswith("path:") or dep_url.startswith("git+file:") + dep_url.startswith("path:") + or dep_url.startswith("git+file:") ): continue if dep.get("flake", True):