From ce3ce1cc3f3bce57a3961a37942bc509dfb5e455 Mon Sep 17 00:00:00 2001 From: Alexander Kassouni Date: Sat, 26 Sep 2026 11:41:51 -0700 Subject: reorganize firefox, laptop stuff --- users/kassouni/desktop/sway/sway.nix | 6 ++- users/kassouni/firefox.nix | 91 ----------------------------------- users/kassouni/firefox/default.nix | 6 +++ users/kassouni/firefox/extensions.nix | 32 ++++++++++++ users/kassouni/firefox/firefox.nix | 59 +++++++++++++++++++++++ users/kassouni/git.nix | 1 + users/kassouni/home.nix | 4 +- users/kassouni/newsboat.nix | 28 +++++++++++ users/kassouni/palette/bluetooth.nix | 17 ++++--- users/kassouni/theme.nix | 2 +- 10 files changed, 144 insertions(+), 102 deletions(-) delete mode 100644 users/kassouni/firefox.nix create mode 100644 users/kassouni/firefox/default.nix create mode 100644 users/kassouni/firefox/extensions.nix create mode 100644 users/kassouni/firefox/firefox.nix create mode 100644 users/kassouni/newsboat.nix (limited to 'users/kassouni') diff --git a/users/kassouni/desktop/sway/sway.nix b/users/kassouni/desktop/sway/sway.nix index 2e73d5f..f949bd7 100644 --- a/users/kassouni/desktop/sway/sway.nix +++ b/users/kassouni/desktop/sway/sway.nix @@ -3,6 +3,9 @@ config, ... }: +let + modifier = "Mod4"; +in { programs.swaylock.enable = true; wayland.windowManager.sway = { @@ -12,7 +15,7 @@ config = { window.titlebar = false; menu = "fuzzel"; - modifier = "Mod4"; + inherit modifier; # Use kitty as default terminal terminal = "ghostty"; }; @@ -27,6 +30,7 @@ bindsym XF86MonBrightnessUp exec ${brightnessctl} set -e +${incr}% bindsym XF86AudioRaiseVolume exec wpctl set-volume @DEFAULT_SINK@ ${incr}%+ bindsym XF86AudioLowerVolume exec wpctl set-volume @DEFAULT_SINK@ ${incr}%- + bindsym ${modifier}+p exec open-palette-fuzzel input "type:keyboard" { xkb_options caps:escape } diff --git a/users/kassouni/firefox.nix b/users/kassouni/firefox.nix deleted file mode 100644 index 3b9d30a..0000000 --- a/users/kassouni/firefox.nix +++ /dev/null @@ -1,91 +0,0 @@ -{ pkgs, ... }: -{ - programs.firefox = { - enable = true; - - policies = { - ExtensionSettings = { - "uBlock0@raymondhill.net" = { - default_area = "navbar"; - install_url = "https://addons.mozilla.org/firefox/downloads/latest/ublock-origin/latest.xpi"; - installation_mode = "normal_installed"; - private_browsing = true; - }; - - - "{d634138d-c276-4fc8-924b-40a0ea21d284}" = { - default_area = "navbar"; - install_url = "https://addons.mozilla.org/firefox/downloads/latest/1password-x-password-manager/latest.xpi"; - installation_mode = "normal_installed"; - private_browsing = true; - }; - - "{9063c2e9-e07c-4c2c-9646-cfe7ca8d0498}" = { - default_area = "menupanel"; - install_url = "https://addons.mozilla.org/firefox/downloads/latest/old-reddit-redirect/latest.xpi"; - installation_mode = "normal_installed"; - private_browsing = true; - }; - - "{d7742d87-e61d-4b78-b8a1-b469842139fa}" = { - default_area = "menupanel"; - install_url = "https://addons.mozilla.org/firefox/downloads/latest/vimium-ff/latest.xpi"; - installation_mode = "normal_installed"; - private_browsing = true; - }; - }; - }; - - profiles.kassouni = { - isDefault = true; - bookmarks = { - force = true; - settings = [ - { - name = "wikipedia"; - tags = [ "wiki" ]; - keyword = "wiki"; - url = "https://en.wikipedia.org/wiki/Special:Search?search=%s&go=Go"; - } - { - name = "Nix sites"; - toolbar = true; - bookmarks = [ - { - name = "homepage"; - url = "https://nixos.org/"; - } - { - name = "wiki"; - tags = [ - "wiki" - "nix" - ]; - url = "https://wiki.nixos.org/"; - } - ]; - } - ]; - }; - settings = { - "browser.startup.homepage" = "about:blank"; - "browser.compactmode.show" = true; - "startup.homepage_welcome_url" = "about:blank"; - "extensions.autoDisableScopes" = 0; - "browser.newtabpage.enabled" = false; - "identity.fxaccounts.enabled" = false; - "browser.newtabpage.activity-stream.discoverystream.enabled" = false; - "browser.newtabpage.activity-stream.enabled" = false; - "browser.newtabpage.activity-stream.showSponsored" = false; - "browser.newtabpage.activity-stream.showSponsoredTopSites" = false; - "browser.newtabpage.activity-stream.widgets.enabled" = false; - "browser.newtabpage.activity-stream.discoverystream.sections.enabled" = false; - - }; - search = { - force = true; - default = "google"; - }; - }; - }; -} diff --git a/users/kassouni/firefox/default.nix b/users/kassouni/firefox/default.nix new file mode 100644 index 0000000..abba9ea --- /dev/null +++ b/users/kassouni/firefox/default.nix @@ -0,0 +1,6 @@ +{...}: { + imports = [ + ./extensions.nix + ./firefox.nix + ]; +} diff --git a/users/kassouni/firefox/extensions.nix b/users/kassouni/firefox/extensions.nix new file mode 100644 index 0000000..7664918 --- /dev/null +++ b/users/kassouni/firefox/extensions.nix @@ -0,0 +1,32 @@ +{...}:{ + programs.firefox.policies.ExtensionSettings = { + "uBlock0@raymondhill.net" = { + default_area = "navbar"; + install_url = "https://addons.mozilla.org/firefox/downloads/latest/ublock-origin/latest.xpi"; + installation_mode = "normal_installed"; + private_browsing = true; + }; + "{d634138d-c276-4fc8-924b-40a0ea21d284}" = { + default_area = "navbar"; + install_url = "https://addons.mozilla.org/firefox/downloads/latest/1password-x-password-manager/latest.xpi"; + installation_mode = "normal_installed"; + private_browsing = true; + }; + + "{9063c2e9-e07c-4c2c-9646-cfe7ca8d0498}" = { + default_area = "menupanel"; + install_url = "https://addons.mozilla.org/firefox/downloads/latest/old-reddit-redirect/latest.xpi"; + installation_mode = "normal_installed"; + private_browsing = true; + }; + + "{d7742d87-e61d-4b78-b8a1-b469842139fa}" = { + default_area = "menupanel"; + install_url = "https://addons.mozilla.org/firefox/downloads/latest/vimium-ff/latest.xpi"; + installation_mode = "normal_installed"; + private_browsing = true; + }; + }; +} + + diff --git a/users/kassouni/firefox/firefox.nix b/users/kassouni/firefox/firefox.nix new file mode 100644 index 0000000..2d9f906 --- /dev/null +++ b/users/kassouni/firefox/firefox.nix @@ -0,0 +1,59 @@ +{ pkgs, ... }: +{ + programs.firefox = { + enable = true; + + profiles.kassouni = { + isDefault = true; + bookmarks = { + force = true; + settings = [ + { + name = "wikipedia"; + tags = [ "wiki" ]; + keyword = "wiki"; + url = "https://en.wikipedia.org/wiki/Special:Search?search=%s&go=Go"; + } + { + name = "Nix sites"; + toolbar = true; + bookmarks = [ + { + name = "homepage"; + url = "https://nixos.org/"; + } + { + name = "wiki"; + tags = [ + "wiki" + "nix" + ]; + url = "https://wiki.nixos.org/"; + } + ]; + } + ]; + }; + settings = { + "browser.ml.linkPreview.enabled" = false; + "browser.startup.homepage" = "about:blank"; + "browser.compactmode.show" = true; + "startup.homepage_welcome_url" = "about:blank"; + "extensions.autoDisableScopes" = 0; + "browser.newtabpage.enabled" = false; + "identity.fxaccounts.enabled" = false; + "browser.newtabpage.activity-stream.discoverystream.enabled" = false; + "browser.newtabpage.activity-stream.enabled" = false; + "browser.newtabpage.activity-stream.showSponsored" = false; + "browser.newtabpage.activity-stream.showSponsoredTopSites" = false; + "browser.newtabpage.activity-stream.widgets.enabled" = false; + "browser.newtabpage.activity-stream.discoverystream.sections.enabled" = false; + + }; + search = { + force = true; + default = "google"; + }; + }; + }; +} diff --git a/users/kassouni/git.nix b/users/kassouni/git.nix index 03579cd..7740ac1 100644 --- a/users/kassouni/git.nix +++ b/users/kassouni/git.nix @@ -6,6 +6,7 @@ name = "Alexander Kassouni"; email = "alex@kassouni.net"; }; + push.autoSetupRemote = true; init = { defaultBranch = "main"; }; diff --git a/users/kassouni/home.nix b/users/kassouni/home.nix index 84b69f1..d9e389d 100644 --- a/users/kassouni/home.nix +++ b/users/kassouni/home.nix @@ -10,6 +10,7 @@ ./claude.nix ./music.nix ./fonts.nix + ./newsboat.nix ./slippi.nix ./ssh.nix ./desktop/sway @@ -19,7 +20,7 @@ ./git.nix ./ghostty.nix ./theme.nix - ./firefox.nix + ./firefox ./cursor.nix ./bash.nix ./scripts @@ -37,6 +38,7 @@ btop wget tree + calibre nerd-fonts.blex-mono ripgrep curl diff --git a/users/kassouni/newsboat.nix b/users/kassouni/newsboat.nix new file mode 100644 index 0000000..cde761c --- /dev/null +++ b/users/kassouni/newsboat.nix @@ -0,0 +1,28 @@ +{...}: +{ + programs.newsboat = { + enable = true; + urls = [ + { + url = "https://xeiaso.net/blog.rss"; + title = "Xe Iaso's Blog"; + } + + { + url = "https://reasonablypolymorphic.com/feed.rss"; + title = "Reasonably Polymorphic"; + } + + { + url = "https://esoteric.codes/rss"; + title = "ESOTERIC.CODES"; + } + + { + url = "https://100r.co/links/rss.xml"; + title = "100R"; + } + ]; + }; +} + diff --git a/users/kassouni/palette/bluetooth.nix b/users/kassouni/palette/bluetooth.nix index 71e1aaf..4d2a594 100644 --- a/users/kassouni/palette/bluetooth.nix +++ b/users/kassouni/palette/bluetooth.nix @@ -13,14 +13,13 @@ # The interpolated store paths below are longer than 79 columns. flakeIgnore = [ "E501" ]; } '' - import html import json import subprocess import sys BT = "${pkgs.bluez}/bin/bluetoothctl" JC = "${pkgs.jc}/bin/jc" - ROFI = "${pkgs.rofi}/bin/rofi" + FUZZEL = "${pkgs.fuzzel}/bin/fuzzel" def devices(*args): @@ -38,10 +37,9 @@ def label(device, connected): - """Pango markup row. Names are escaped, they are not our text.""" - name = html.escape(device["name"]) + name = device["name"] if device["address"] in connected: - name += ' connected' + name += " (connected)" return name @@ -56,8 +54,7 @@ rows = [label(d, connected) for d in known] choice = subprocess.run( - [ROFI, "-dmenu", "-i", "-markup-rows", "-format", "i", - "-p", "bluetooth"], + [FUZZEL, "--dmenu", "--index", "--prompt", "bluetooth "], input="\n".join(rows), capture_output=True, text=True, @@ -65,7 +62,11 @@ if choice.returncode != 0: return 1 - device = known[int(choice.stdout.strip())] + index = int(choice.stdout.strip() or -1) + if not 0 <= index < len(known): + return 1 + + device = known[index] action = ( "disconnect" if device["address"] in connected else "connect" ) diff --git a/users/kassouni/theme.nix b/users/kassouni/theme.nix index 70785ca..2bc7c03 100644 --- a/users/kassouni/theme.nix +++ b/users/kassouni/theme.nix @@ -6,7 +6,7 @@ font = { size = lib.mkOption { type = lib.types.int; - default = 16; + default = 12; description = "Global font size for all applications"; }; -- cgit v1.3.1