From f113304824a95a1125fa4dcce6ee983a278aa7c1 Mon Sep 17 00:00:00 2001 From: Kat Inskip Date: Thu, 20 Mar 2025 17:32:14 -0700 Subject: [PATCH] feat: redo firefox... o: --- flake.lock | 6 +- home/environments/i3/conky/components.lua | 1 - home/environments/i3/i3.nix | 6 ++ home/profiles/graphical/discord.nix | 8 +- home/profiles/graphical/firefox.nix | 111 +++++++++++++++++++++- home/profiles/neovim/default.nix | 7 +- home/profiles/neovim/rust.lua | 18 ++++ nixos/profiles/graphical/sound.nix | 26 ----- 8 files changed, 146 insertions(+), 37 deletions(-) create mode 100644 home/profiles/neovim/rust.lua diff --git a/flake.lock b/flake.lock index c584ed6c..f6455b51 100644 --- a/flake.lock +++ b/flake.lock @@ -1090,11 +1090,11 @@ }, "nixpkgs_7": { "locked": { - "lastModified": 1742069588, - "narHash": "sha256-C7jVfohcGzdZRF6DO+ybyG/sqpo1h6bZi9T56sxLy+k=", + "lastModified": 1742288794, + "narHash": "sha256-Txwa5uO+qpQXrNG4eumPSD+hHzzYi/CdaM80M9XRLCo=", "owner": "nixos", "repo": "nixpkgs", - "rev": "c80f6a7e10b39afcc1894e02ef785b1ad0b0d7e5", + "rev": "b6eaf97c6960d97350c584de1b6dcff03c9daf42", "type": "github" }, "original": { diff --git a/home/environments/i3/conky/components.lua b/home/environments/i3/conky/components.lua index 7c0966f7..8a5fc31e 100644 --- a/home/environments/i3/conky/components.lua +++ b/home/environments/i3/conky/components.lua @@ -184,7 +184,6 @@ end -- GPU Display function conky_gpu_section() gpus = gpu_csv_query() - -- TODO: Replace NVIDIA-SMI separate calls with all 1 call and a CSV parsing local text = "" for idx, gpu in pairs(gpus) do for i=1,#gpu do diff --git a/home/environments/i3/i3.nix b/home/environments/i3/i3.nix index 3ba8f04d..780fada3 100644 --- a/home/environments/i3/i3.nix +++ b/home/environments/i3/i3.nix @@ -15,6 +15,7 @@ in { pcmanfm pavucontrol xclip + obs-studio ]; services.i3gopher.enable = true; xsession.windowManager.i3 = let @@ -138,6 +139,11 @@ in { class = "^Discord$"; } ]; + ${workspaceNamer 13} = [ + { + class = "^mpv$"; + } + ]; ${workspaceNamer 14} = [ { class = "^Spotify$"; diff --git a/home/profiles/graphical/discord.nix b/home/profiles/graphical/discord.nix index 41394423..c80c87c0 100644 --- a/home/profiles/graphical/discord.nix +++ b/home/profiles/graphical/discord.nix @@ -6,8 +6,12 @@ inherit (lib.generators) toJSON; in { home.packages = with pkgs; [ - discord - betterdiscordctl + (discord-krisp.override { + withOpenASAR = true; + withVencord = true; # can do this here too + }) + vesktop + #betterdiscordctl ]; xdg.configFile."discord/settings.json".text = toJSON {} { "SKIP_HOST_UPDATE" = true; diff --git a/home/profiles/graphical/firefox.nix b/home/profiles/graphical/firefox.nix index 34237737..723ff96c 100644 --- a/home/profiles/graphical/firefox.nix +++ b/home/profiles/graphical/firefox.nix @@ -1,14 +1,46 @@ -{nur, ...}: { +{pkgs, nur, ...}: let + defaultFont = "Monaspace Krypton"; +in { home.sessionVariables = { BROWSER = "firefox"; }; + home.packages = [ pkgs.ff2mpv-rust ]; programs.firefox = { + nativeMessagingHosts = [ + pkgs.ff2mpv-rust + ]; enable = true; profiles = { main = { id = 0; isDefault = true; + containers = { + main = { + name = "Main"; + id = 0; + color = "turquoise"; + icon = "pet"; + }; + gay = { + name = "Gay"; + id = 1; + color = "purple"; + icon = "pet"; + }; + work = { + name = "Work"; + id = 2; + color = "pink"; + icon = "briefcase"; + }; + banking = { + name = "Banking"; + id = 3; + color = "turquoise"; + }; + }; + containersForce = true; extensions = { packages = with nur.repos.rycee.firefox-addons; [ sponsorblock @@ -26,6 +58,15 @@ df-youtube old-reddit-redirect privacy-badger + tree-style-tab + move-unloaded-tabs-for-tst + tab-unload-for-tree-style-tab + tst-bookmarks-subpanel + tst-active-tab-on-scroll-bar + tst-indent-line + tst-tab-search + tst-wheel-and-double + tst-more-tree-commands reddit-enhancement-suite refined-github stylus @@ -36,12 +77,64 @@ betterttv violentmonkey return-youtube-dislikes - iina-open-in-mpv + ff2mpv ]; + force = true; settings = { + "uBlock@raymondhill.net".settings = { + selectedFilterLists = [ + "user-filters" + "ublock-filters" + "ublock-badware" + "ublock-privacy" + "ublock-quick-fixes" + "ublock-unbreak" + "easylist" + "adguard-generic" + "adguard-mobile" + "easyprivacy" + "adguard-spyware" + "adguard-spyware-url" + "urlhaus-1" + "plowe-0" + "fanboy-cookiemonster" + "ublock-cookies-easylist" + "adguard-cookies" + "ublock-cookies-adguard" + "fanboy-social" + "adguard-social" + "easylist-chat" + "easylist-newsletters" + "easylist-notifications" + "easylist-annoyances" + "adguard-mobile-app-banners" + "adguard-other-annoyances" + "adguard-popup-overlays" + "adguard-widgets" + "ublock-annoyances" + ]; + }; + "treestyletab@piro.sakura.ne.jp".settings = { + cachedExternalAddons = [ + "tst-active-tab-on-scrollbar@piro.sakura.ne.jp" + "tst-indent-line@piro.sakura.ne.jp" + ]; + faviconizePinnedTabs = false; + lastSelectedSubPanelProviderId = "tst-bookmarks-subpanel@piro.sakura.ne.jp"; + showExpertOptions = true; + skipCollapsedTabsForTabSwitchingShortcuts = true; + tabPreviewTooltip = true; + }; }; }; settings = { + # Stylin' + font = { + default = { + x-western = defaultFont; + x-unicode = defaultFont; + }; + }; # Derived from https://github.com/arcnmx/home/blob/9eb1cd4dd43883e1a0c6a2a55c00d7c3bede1776/cfg/firefox/default.nix#L7 # and https://git.ztn.sh/zotan/snowleopard/src/branch/dev/assets/prefs.js "services.sync.engine.prefs" = false; @@ -157,7 +250,19 @@ }; userChrome = '' #urlbar { - font-family: "Monaspace Krypton", monospace; + font-family: "${defaultFont}", monospace; + } + /* Hide horizontal tabs at the top of the window */ + #main-window[tabsintitlebar="true"]:not([extradragspace="true"]) #TabsToolbar { + opacity: 0; + pointer-events: none; + } + #main-window #TabsToolbar { + visibility: collapse !important; + } + /* Hide the "Tree Style Tab" header at the top of the sidebar */ + #sidebar-box[sidebarcommand="treestyletab_piro_sakura_ne_jp-sidebar-action"] #sidebar-header { + display: none; } ''; }; diff --git a/home/profiles/neovim/default.nix b/home/profiles/neovim/default.nix index 5dcb405e..20d03777 100644 --- a/home/profiles/neovim/default.nix +++ b/home/profiles/neovim/default.nix @@ -19,7 +19,6 @@ (set.filter (var: _: string.hasInfix "base" var) config.base16.defaultScheme)); in { home.sessionVariables = mkIf config.programs.neovim.enable {EDITOR = "nvim";}; - programs.neovim = { enable = true; vimAlias = true; @@ -57,6 +56,7 @@ in { bufferline-nvim # Language Server nvim-lspconfig + rustaceanvim # tree nui-nvim neo-tree-nvim @@ -95,5 +95,8 @@ in { clangStdenv.cc ]; }; - xdg.configFile."nvim/init.lua".source = initLua; + xdg.configFile = { + "nvim/init.lua".source = initLua; + "nvim/after/ftplugin/rust.lua".source = ./rust.lua; + }; } diff --git a/home/profiles/neovim/rust.lua b/home/profiles/neovim/rust.lua new file mode 100644 index 00000000..cfcedf00 --- /dev/null +++ b/home/profiles/neovim/rust.lua @@ -0,0 +1,18 @@ +local bufnr = vim.api.nvim_get_current_buf() +vim.keymap.set( + "n", + "a", + function() + vim.cmd.RustLsp('codeAction') -- supports rust-analyzer's grouping + -- or vim.lsp.buf.codeAction() if you don't want grouping. + end, + { silent = true, buffer = bufnr } +) +vim.keymap.set( + "n", + "K", -- Override Neovim's built-in hover keymap with rustaceanvim's hover actions + function() + vim.cmd.RustLsp({'hover', 'actions'}) + end, + { silent = true, buffer = bufnr } +) diff --git a/nixos/profiles/graphical/sound.nix b/nixos/profiles/graphical/sound.nix index c3f84803..b1c80d33 100644 --- a/nixos/profiles/graphical/sound.nix +++ b/nixos/profiles/graphical/sound.nix @@ -5,32 +5,6 @@ security.rtkit.enable = true; -services.pipewire.extraConfig.pipewire-pulse."92-low-latency" = { - context.modules = [ - { - name = "libpipewire-module-protocol-pulse"; - args = { - pulse.min.req = "32/48000"; - pulse.default.req = "32/48000"; - pulse.max.req = "32/48000"; - pulse.min.quantum = "32/48000"; - pulse.max.quantum = "32/48000"; - }; - } - ]; - stream.properties = { - node.latency = "32/48000"; - resample.quality = 1; - }; -}; - services.pipewire.extraConfig.pipewire."92-low-latency" = { - "context.properties" = { - "default.clock.rate" = 48000; - "default.clock.quantum" = 32; - "default.clock.min-quantum" = 32; - "default.clock.max-quantum" = 32; - }; - }; services.pipewire = { enable = true; pulse.enable = true;