{ pkgs, config, lib, ... }: let nixGLIntelPrefix = "${pkgs.nixgl.nixVulkanIntel}/bin/nixVulkanIntel ${pkgs.nixgl.nixGLIntel}/bin/nixGLIntel "; wmPrefix = "${lib.optionalString config.frogeye.desktop.nixGLIntel nixGLIntelPrefix}"; in { imports = [ ./audio ./autorandr ./frobar ./i3.nix ./lock ./mpd ./qutebrowser.nix ./screenshots ]; config = lib.mkIf config.frogeye.desktop.xorg { xsession = { enable = true; # Not using config.xdg.configHome because it needs to be $HOME-relative paths and path manipulation is hard scriptPath = ".config/xsession"; profilePath = ".config/xprofile"; windowManager = { command = lib.mkForce "${wmPrefix} ${config.xsession.windowManager.i3.package}/bin/i3"; i3.enable = true; }; numlock.enable = config.frogeye.desktop.numlock; }; programs = { # Terminal alacritty = { # TODO Emojis. Or maybe they work on NixOS? # Arch (working) shows this with alacritty -vvv: # [TRACE] [crossfont] Got font path="/usr/share/fonts/twemoji/twemoji.ttf", index=0 # [DEBUG] [crossfont] Loaded Face Face { ft_face: Font Face: Regular, load_flags: MONOCHROME | TARGET_MONO | COLOR, render_mode: "Mono", lcd_filter: 1 } # Nix (not working) shows this: # [TRACE] [crossfont] Got font path="/nix/store/872g3w9vcr5nh93r0m83a3yzmpvd2qrj-home-manager-path/share/fonts/truetype/TwitterColorEmoji-SVGinOT.ttf", index=0 # [DEBUG] [crossfont] Loaded Face Face { ft_face: Font Face: Regular, load_flags: TARGET_LIGHT | COLOR, render_mode: "Lcd", lcd_filter: 1 } enable = true; settings = { bell = { animation = "EaseOutExpo"; color = "#000000"; command = { program = "${pkgs.sox}/bin/play"; args = [ "-n" "synth" "sine" "C5" "sine" "E4" "remix" "1-2" "fade" "0.1" "0.2" "0.1" ]; }; duration = 100; }; cursor = { vi_mode_style = "Underline"; }; env = { WINIT_X11_SCALE_FACTOR = "1"; # Prevents Alacritty from resizing from one monitor to another. # Might cause issue on HiDPI screens but we'll get there when we get there }; hints = { enabled = [ { binding = { mods = "Control|Alt"; key = "F"; }; command = "${pkgs.xdg-utils}/bin/xdg-open"; mouse = { enabled = true; mods = "Control"; }; post_processing = true; regex = "(mailto:|gemini:|gopher:|https:|http:|news:|file:|git:|ssh:|ftp:)[^\\u0000-\\u001F\\u007F-\\u009F<>\"\\\\s{-}\\\\^⟨⟩`]+"; } ]; }; key_bindings = [ { mode = "~Search"; mods = "Alt|Control"; key = "Space"; action = "ToggleViMode"; } { mode = "Vi|~Search"; mods = "Control"; key = "K"; action = "ScrollHalfPageUp"; } { mode = "Vi|~Search"; mods = "Control"; key = "J"; action = "ScrollHalfPageDown"; } { mode = "~Vi"; mods = "Control|Alt"; key = "V"; action = "Paste"; } { mods = "Control|Alt"; key = "C"; action = "Copy"; } { mode = "~Search"; mods = "Control|Alt"; key = "F"; action = "SearchForward"; } { mode = "~Search"; mods = "Control|Alt"; key = "B"; action = "SearchBackward"; } { mode = "Vi|~Search"; mods = "Control|Alt"; key = "C"; action = "ClearSelection"; } ]; window = { dynamic_padding = false; dynamic_title = true; }; }; }; bash.shellAliases = { x = "startx ${config.home.homeDirectory}/${config.xsession.scriptPath}; logout"; lmms = "lmms --config ${config.xdg.configHome}/lmmsrc.xml"; }; # Backup terminal urxvt = { enable = true; package = pkgs.rxvt-unicode-emoji; scroll = { bar.enable = false; }; iso14755 = false; # Disable Ctrl+Shift default bindings keybindings = { "Shift-Control-C" = "eval:selection_to_clipboard"; "Shift-Control-V" = "eval:paste_clipboard"; # TODO Not sure resizing works, Nix doesn't have the package (urxvt-resize-font-git on Arch) "Control-KP_Subtract" = "resize-font:smaller"; "Control-KP_Add" = "resize-font:bigger"; }; extraConfig = { "letterSpace" = 0; "perl-ext-common" = "resize-font,bell-command,readline,selection"; "bell-command" = "${pkgs.sox}/bin/play -n synth sine C5 sine E4 remix 1-2 fade 0.1 0.2 0.1 &> /dev/null"; }; }; rofi = { # TODO This theme template, that was used for Arch, looks much better: # https://gitlab.com/jordiorlando/base16-rofi/-/blob/master/templates/default.mustache enable = true; pass.enable = true; extraConfig = { lazy-grab = false; matching = "regex"; }; }; mpv = { enable = true; config = { audio-display = false; save-position-on-quit = true; osc = false; # Required by thumbnail script # Hardware acceleration (from https://nixos.wiki/wiki/Accelerated_Video_Playback#MPV) hwdec = "auto-safe"; vo = "gpu"; profile = "gpu-hq"; }; scripts = with pkgs.mpvScripts; [ thumbnail ]; scriptOpts = { mpv_thumbnail_script = { autogenerate = false; # TODO It creates too many processes at once, crashing the system cache_directory = "/tmp/mpv_thumbs_${config.home.username}"; mpv_hwdec = "auto-safe"; }; }; }; qutebrowser.enable = true; }; xdg = { userDirs = { enable = true; # TODO Which ones do we want? createDirectories = true; # French, because then it there's a different initial for each, making navigation easier desktop = null; download = "${config.home.homeDirectory}/Téléchargements"; pictures = "${config.home.homeDirectory}/Images"; publicShare = null; templates = null; videos = "${config.home.homeDirectory}/Vidéos"; }; configFile = { "rofimoji.rc" = { text = '' skin-tone = neutral files = [emojis, math] action = clipboard ''; }; }; }; services = { blueman-applet.enable = true; unclutter.enable = true; dunst = { enable = true; settings = # TODO Change dmenu for rofi, so we can use context with config.lib.stylix.colors.withHashtag; { global = { separator_color = lib.mkForce base05; idle_threshold = 120; markup = "full"; max_icon_size = 48; # TODO Those shortcuts don't seem to work, maybe try: # > define shortcuts inside your window manager and bind them to dunstctl(1) commands close_all = "ctrl+mod4+n"; close = "mod4+n"; context = "mod1+mod4+n"; history = "shift+mod4+n"; }; urgency_low = { background = lib.mkForce base01; foreground = lib.mkForce base03; frame_color = lib.mkForce base05; }; urgency_normal = { background = lib.mkForce base02; foreground = lib.mkForce base05; frame_color = lib.mkForce base05; }; urgency_critical = { background = lib.mkForce base08; foreground = lib.mkForce base06; frame_color = lib.mkForce base05; }; }; }; }; home = { file = { ".face" = { # TODO Only works on pindakaas? See https://wiki.archlinux.org/title/LightDM#Changing_your_avatar source = pkgs.runCommand "face.png" { } "${pkgs.inkscape}/bin/inkscape ${./face.svg} -w 1024 -o $out"; }; }; packages = with pkgs; [ # remote tigervnc # multimedia common gimp inkscape libreoffice # data management freefilesync # browsers firefox # fonts dejavu_fonts twemoji-color-font gnome.gedit feh zbar zathura meld python3Packages.magic # x11-exclusive numlockx simplescreenrecorder trayer xclip keynav xorg.xinit # TODO Make this clean. Service? # organisation thunderbird ]; sessionVariables = { RXVT_SOCKET = "${config.xdg.stateHome}/urxvtd"; # Used to want -$HOME suffix, hopefullt this isn't needed # XAUTHORITY = "${config.xdg.configHome}/Xauthority"; # Disabled as this causes lock-ups with DMs }; }; }; }