From 8b022298e2d84453e2e49b96f00cef8df1138769 Mon Sep 17 00:00:00 2001 From: reidlab Date: Sun, 22 Mar 2026 16:59:30 -0700 Subject: [PATCH] vicinae, other tweaks --- default.nix | 4 + flake.lock | 114 ++++++++++++++++++ flake.nix | 4 + hosts/goopnet-interface/default.nix | 4 +- modules/desktop/default.nix | 6 - modules/desktop/niri.nix | 33 +++-- modules/desktop/regreet.nix | 16 +-- modules/desktop/themes/catppuccin/default.nix | 2 + modules/desktop/themes/catppuccin/waybar.css | 3 - modules/desktop/themes/default.nix | 20 ++- modules/desktop/vicinae.nix | 71 +++++++++++ modules/hardware/networking.nix | 18 +++ modules/nix.nix | 2 + 13 files changed, 254 insertions(+), 43 deletions(-) create mode 100644 modules/desktop/vicinae.nix create mode 100644 modules/hardware/networking.nix diff --git a/default.nix b/default.nix index d8206dd..81930bf 100755 --- a/default.nix +++ b/default.nix @@ -14,6 +14,10 @@ in { ] ++ (mapModulesRec' (toString ./modules) import); + hm.imports = [ + inputs.vicinae.homeManagerModules.default + ]; + system.stateVersion = "23.11"; system.configurationRevision = with inputs; mkIf (self ? rev) self.rev; hm.home.stateVersion = config.system.stateVersion; diff --git a/flake.lock b/flake.lock index cca93b7..ef72ce5 100644 --- a/flake.lock +++ b/flake.lock @@ -535,6 +535,22 @@ "type": "github" } }, + "nixpkgs_5": { + "locked": { + "lastModified": 1772542754, + "narHash": "sha256-WGV2hy+VIeQsYXpsLjdr4GvHv5eECMISX1zKLTedhdg=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "8c809a146a140c5c8806f13399592dbcb1bb5dc4", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, "rofi-catppuccin": { "flake": false, "locked": { @@ -565,6 +581,8 @@ "nixpkgs": "nixpkgs_4", "rofi-catppuccin": "rofi-catppuccin", "systems": "systems_3", + "vicinae": "vicinae", + "vicinae-extensions": "vicinae-extensions", "waybar-catppuccin": "waybar-catppuccin" } }, @@ -613,6 +631,102 @@ "type": "github" } }, + "systems_4": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_5": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "vicinae": { + "inputs": { + "nixpkgs": "nixpkgs_5", + "systems": "systems_4" + }, + "locked": { + "lastModified": 1774140862, + "narHash": "sha256-OQC0RntH2eeSGYGnG5C8kdKxnJIi+KYh7usLMoBVYec=", + "owner": "vicinaehq", + "repo": "vicinae", + "rev": "9076d4cba5bcade305b7e78cd68759ad2b34a5a3", + "type": "github" + }, + "original": { + "owner": "vicinaehq", + "repo": "vicinae", + "type": "github" + } + }, + "vicinae-extensions": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ], + "systems": "systems_5", + "vicinae": "vicinae_2" + }, + "locked": { + "lastModified": 1773786526, + "narHash": "sha256-GVIbXYiA506LV0cEsG1AA4vTwDJq9R6v6lFFs8z7knY=", + "owner": "vicinaehq", + "repo": "extensions", + "rev": "50233dff9dfc70fc6b39c2387687e5661b09f005", + "type": "github" + }, + "original": { + "owner": "vicinaehq", + "repo": "extensions", + "type": "github" + } + }, + "vicinae_2": { + "inputs": { + "nixpkgs": [ + "vicinae-extensions", + "nixpkgs" + ], + "systems": [ + "vicinae-extensions", + "systems" + ] + }, + "locked": { + "lastModified": 1768856963, + "narHash": "sha256-u5bWDuwk6oieTnvm1YjNotcYK8iJSddH5+S68+X4TSc=", + "owner": "vicinaehq", + "repo": "vicinae", + "rev": "934bc0ad47be6dbd6498a0dac655c4613fd0ab27", + "type": "github" + }, + "original": { + "owner": "vicinaehq", + "repo": "vicinae", + "type": "github" + } + }, "waybar-catppuccin": { "flake": false, "locked": { diff --git a/flake.nix b/flake.nix index 6906795..c465112 100644 --- a/flake.nix +++ b/flake.nix @@ -16,6 +16,10 @@ niri.url = "github:sodiboo/niri-flake"; + vicinae.url = "github:vicinaehq/vicinae"; + vicinae-extensions.url = "github:vicinaehq/extensions"; + vicinae-extensions.inputs.nixpkgs.follows = "nixpkgs"; + hyprlock.url = "github:hyprwm/hyprlock"; hyprlock.inputs.nixpkgs.follows = "nixpkgs"; hypridle.url = "github:hyprwm/hypridle"; diff --git a/hosts/goopnet-interface/default.nix b/hosts/goopnet-interface/default.nix index d364e2b..cdf6c99 100755 --- a/hosts/goopnet-interface/default.nix +++ b/hosts/goopnet-interface/default.nix @@ -39,6 +39,7 @@ print.enable = true; pointer.enable = true; tablet.enable = true; + networking.enable = true; }; dev = { enable = true; @@ -63,8 +64,9 @@ batsignal.enable = true; wob.enable = true; gammastep.enable = true; - cliphist.enable = true; + # cliphist.enable = true; wl-clip-persist.enable = true; + vicinae.enable = true; # display manager regreet.enable = true; diff --git a/modules/desktop/default.nix b/modules/desktop/default.nix index 54d9ccf..d364895 100644 --- a/modules/desktop/default.nix +++ b/modules/desktop/default.nix @@ -17,15 +17,9 @@ in { modules.desktop.fonts.baseFonts = true; modules.desktop.thumbnailers.enable = true; - # enable networking - networking.networkmanager.enable = true; - networking.networkmanager.wifi.backend = "iwd"; - networking.wireless.iwd.settings.Settings.AutoConnect = true; - # speed up boot # https://discourse.nixos.org/t/boot-faster-by-disabling-udev-settle-and-nm-wait-online/6339 systemd.services.systemd-udev-settle.enable = false; - systemd.services.NetworkManager-wait-online.enable = false; # mounting, trash, and mtp support services.gvfs.enable = true; diff --git a/modules/desktop/niri.nix b/modules/desktop/niri.nix index bc686be..522c90a 100644 --- a/modules/desktop/niri.nix +++ b/modules/desktop/niri.nix @@ -291,44 +291,41 @@ in { } ]; + # TODO: add shadows onto notifications. weird geometry beware !!! + # TODO: add shadows onto waybar again, but make it show the shadow drops behind the windows + # TODO: rounded vicinae layer-rules = [ { matches = [ { namespace = "^notifications$"; } - { namespace = "^rofi$"; } # a bit silly, but we use rofi for clipboard history + # obliterate all dmenu-like things--too dangerous to stream (clipboard history, passwords) + { namespace = "^rofi$"; } + { namespace = "^vicinae$"; } + { namespace = "^launcher$"; } ]; block-out-from = "screen-capture"; } { matches = [ { namespace = "^launcher$"; } - { namespace = "^notifications$"; } { namespace = "^rofi$"; } - { namespace = "^waybar$"; } + { namespace = "^vicinae$"; } { namespace = "^wob$"; } ]; shadow = { enable = true; }; } - # special rounded corner cases. gah!! - # also for some reason int literals aren't accepted - # so multiply by 1.0 to make it a float + # shadow rounded corner cases... + # defined in program config but we need to edit geometry too for shadows!! + # monospace { matches = [ + { namespace = "^launcher$"; } { namespace = "^rofi$"; } - { namespace = "^waybar$"; } ]; geometry-corner-radius = allCorners (config.modules.desktop.fonts.fonts.monospace.size * 1.0); # its 1em, so } - { - matches = [ { namespace = "^launcher$"; } ]; - geometry-corner-radius = allCorners (config.hm.programs.fuzzel.settings.border.radius * 1.0); - } - { - matches = [ { namespace = "^notifications$"; } ]; - geometry-corner-radius = allCorners (config.hm.services.dunst.settings.global.corner_radius * 1.0); - } ]; binds = with config.hm.lib.niri.actions; let @@ -336,7 +333,8 @@ in { in { "Mod+Shift+Slash".action = show-hotkey-overlay; - "Mod+D".action = spawn "fuzzel"; + # "Mod+D".action = spawn "fuzzel"; + "Mod+D".action = spawn "vicinae" "vicinae://toggle"; "Mod+Q".action = close-window; @@ -438,7 +436,8 @@ in { "XF86AudioNext".action = sh "${lib.getExe pkgs.playerctl} next"; "Mod+Shift+C".action = sh "${lib.getExe pkgs.hyprpicker} -a"; - "Mod+V".action = sh "${config.modules.desktop.cliphist.summonScript}"; + # "Mod+V".action = sh "${config.modules.desktop.cliphist.summonScript}"; + "Mod+V".action = spawn "vicinae" "vicinae://extensions/vicinae/clipboard/history"; "Mod+Shift+Control+T".action = toggle-debug-tint; "Mod+Shift+Control+O".action = debug-toggle-opaque-regions; diff --git a/modules/desktop/regreet.nix b/modules/desktop/regreet.nix index e6a5aff..e877927 100644 --- a/modules/desktop/regreet.nix +++ b/modules/desktop/regreet.nix @@ -48,23 +48,9 @@ in { fit = "Cover"; }; }; - # TODO: move to theme module - theme = with config.modules.desktop.themes.gtkTheme; { - name = name; - package = package; - }; - iconTheme = with config.modules.desktop.themes.iconTheme; { - name = name; - package = package; - }; - cursorTheme = with config.modules.desktop.themes.cursorTheme; { - name = name; - package = package; - }; font = with config.modules.desktop.fonts.fonts.sansSerif; { + inherit size package; name = family; - size = size; - package = package; }; }; }; diff --git a/modules/desktop/themes/catppuccin/default.nix b/modules/desktop/themes/catppuccin/default.nix index 1787a9e..1b8a5c8 100644 --- a/modules/desktop/themes/catppuccin/default.nix +++ b/modules/desktop/themes/catppuccin/default.nix @@ -102,6 +102,8 @@ in { wezterm = '' config.color_scheme = 'Catppuccin ${pascalCase variant}' ''; + + vicinae = "catppuccin-${variant}"; }; }; } diff --git a/modules/desktop/themes/catppuccin/waybar.css b/modules/desktop/themes/catppuccin/waybar.css index 2271f8c..f9f3d55 100644 --- a/modules/desktop/themes/catppuccin/waybar.css +++ b/modules/desktop/themes/catppuccin/waybar.css @@ -10,11 +10,8 @@ button, button:hover { window#waybar { color: @text; - /* background: alpha(@base, 0.8); */ - /* background: @base; */ background: alpha(@base, 0.9999999); border-radius: 1em; - /* font-family: 'Lexica Ultralegible', 'Atkinson Hyperlegible', "Font Awesome 6 Free", "Noto Sans CJK"; */ font-family: "CozetteVector", monospace, "FontAwesome 6 Free", "Noto Sans CJK"; font-size: 13px; font-style: normal; diff --git a/modules/desktop/themes/default.nix b/modules/desktop/themes/default.nix index a80a3af..5091cd9 100644 --- a/modules/desktop/themes/default.nix +++ b/modules/desktop/themes/default.nix @@ -65,11 +65,13 @@ in { fuzzel = mkOpt (nullOr str) null; wezterm = mkOpt (nullOr str) null; + + vicinae = mkOpt (nullOr str) null; }; config = mkIf (cfg.active != null) { programs.dconf.enable = true; - # i think this may be done by ohome-manager already?? + # i think this may be done by home-manager already?? # better safe than sorry hm.dconf = { enable = true; @@ -114,6 +116,12 @@ in { package = cfg.iconTheme.package; }; + programs.regreet.settings = { + theme = cfg.gtkTheme; + iconTheme = cfg.iconTheme; + cursorTheme = cfg.cursorTheme; + }; + hm.programs.vscode.profiles.default = { extensions = [ cfg.editor.vscode.colorTheme.extension @@ -146,6 +154,16 @@ in { icon-theme = cfg.iconTheme.name; }; + hm.services.vicinae.settings.theme = let + themeConf = { + name = cfg.vicinae; + iconTheme = cfg.iconTheme.name; + }; + in { + light = themeConf; + dark = themeConf; + }; + hm.xdg.configFile = let iniFmt = pkgs.formats.ini {}; diff --git a/modules/desktop/vicinae.nix b/modules/desktop/vicinae.nix new file mode 100644 index 0000000..0d2777b --- /dev/null +++ b/modules/desktop/vicinae.nix @@ -0,0 +1,71 @@ +{ inputs, lib, config, pkgs, system, ... }: + +with lib; +let + cfg = config.modules.desktop.vicinae; +in { + options.modules.desktop.vicinae = { + enable = mkEnableOption "Enable vicinae, a launcher built in react"; + package = mkOption { + type = types.package; + default = inputs.vicinae.packages.${system}.default; + }; + }; + + config = mkIf cfg.enable { + hm.services.vicinae = { + enable = true; + package = cfg.package; + systemd = { + enable = true; + autoStart = true; + environment = { + USE_LAYER_SHELL = 1; + }; + }; + + settings = { + "$schema" = "https://vicinae.com/schemas/config.json"; + + pop_to_root_on_close = true; + + launcher_window = { + opacity = 0.95; + client_side_decorations.enabled = false; + + layer_shell = { + enabled = true; + keyboard_interactivity = "exclusive"; + layer = "top"; + }; + }; + + favorites = [ + "core:search-emojis" + "clipboard:history" + ]; + + providers = { + applications = { + preferences = { + defaultAction = "launch"; + }; + }; + files.enabled = false; + }; + + escape_key_behavior = "close_window"; + + font = let + fonts = config.modules.desktop.fonts.fonts; + in { + normal = { inherit (fonts.sansSerif) family size; }; + }; + }; + + extensions = with inputs.vicinae-extensions.packages.${system}; [ + nix + ] ++ optional config.modules.desktop.niri.enable niri; + }; + }; +} diff --git a/modules/hardware/networking.nix b/modules/hardware/networking.nix new file mode 100644 index 0000000..93d5f34 --- /dev/null +++ b/modules/hardware/networking.nix @@ -0,0 +1,18 @@ +{ pkgs, config, lib, ... }: + +with lib; +let + cfg = config.modules.hardware.networking; +in { + options.modules.hardware.networking = { + enable = mkEnableOption "Enable NetworkManager, a daemon for configuring network interfaces"; + }; + + config = mkIf cfg.enable { + networking.networkmanager.enable = true; + networking.networkmanager.wifi.backend = "iwd"; + networking.wireless.iwd.settings.Settings.AutoConnect = true; + + systemd.services.NetworkManager-wait-online.enable = false; + }; +} diff --git a/modules/nix.nix b/modules/nix.nix index 690e89a..f07e6ac 100644 --- a/modules/nix.nix +++ b/modules/nix.nix @@ -23,6 +23,7 @@ "https://nixpkgs-wayland.cachix.org" "https://wezterm.cachix.org" "https://niri.cachix.org" + "https://vicinae.cachix.org" "https://cache.soopy.moe" ]; trusted-public-keys = [ @@ -30,6 +31,7 @@ "nixpkgs-wayland.cachix.org-1:3lwxaILxMRkVhehr5StQprHdEo4IrE8sRho9R9HOLYA=" "wezterm.cachix.org-1:kAbhjYUC9qvblTE+s7S+kl5XM1zVa4skO+E/1IDWdH0=" "niri.cachix.org-1:Wv0OmO7PsuocRKzfDoJ3mulSl7Z6oezYhGhR+3W2964=" + "vicinae.cachix.org-1:1kDrfienkGHPYbkpNj1mWTr7Fm1+zcenzgTizIcI3oc=" "cache.soopy.moe-1:0RZVsQeR+GOh0VQI9rvnHz55nVXkFardDqfm4+afjPo=" ]; };