nix-config

My personal nixos and home-manager configuration
Log | Files | Refs | README

commit 449d1c37bb31d88665d2deff3f3d45a92134cc4d
parent b54913b3edd2a110b3c7dabfc0ec6018ceac0dec
Author: benjamin paul <bpaul@bpaul.xyz>
Date:   Fri,  2 Jul 2021 20:46:21 +1000

Setup basic rofi, still have to do theming properly (dracula and tokyo dark compatibility) and usecases

Diffstat:
Ahome/modules/graphical/rofi.nix | 142+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mhome/modules/xorg/xbindkeys.nix | 2+-
Mhome/profiles/laptop.nix | 1+
Mhome/themes/gruvbox/default.nix | 2++
4 files changed, 146 insertions(+), 1 deletion(-)

diff --git a/home/modules/graphical/rofi.nix b/home/modules/graphical/rofi.nix @@ -0,0 +1,142 @@ +{ config, pkgs, lib, ... }: + +with lib; + +{ + options.rofi = { + enable = mkEnableOption "Rofi"; + + theme = mkOption { + type = types.nullOr types.string; + default = null; + example = "gruvbox-dark-hard"; + description = "Theme from rofi-theme-selector"; + }; + + borderWidth = mkOption { + type = types.nullOr types.int; + default = null; + example = 1; + description = "Border Width"; + }; + + font = mkOption { + type = types.str; + default = "Hack 10"; + example = "Hack 10"; + description = "Font used"; + }; + + padding = mkOption { + type = types.nullOr types.int; + default = null; + example = 400; + description = "Padding"; + }; + + scrollbar = mkOption { + type = types.nullOr types.bool; + default = null; + example = true; + description = "Whether or not the scrollbar should be shown"; + }; + + separator = mkOption { + type = types.nullOr types.oneOf [ "none" "dash" "solid" ]; + default = null; + example = "solid"; + description = "Separator style"; + }; + + location = mkOption { + type = types.oneOf [ + "bottom" + "bottom-left" + "bottom-right" + "center" + "left" + "right" + "top" + "top-left" + "top-right" + ]; + default = "center"; + description = "The default location of rofi on the screen"; + }; + + width = mkOption { + types = types.nullOr types.int; + default = null; + example = 100; + description = "Width of the window"; + }; + + xoffset = mkOption { + types = types.int; + default = 0; + example = 50; + description = "Translate the window by this many pixels along the x axis"; + }; + + yoffset = mkOption { + types = types.int; + default = 0; + example = 50; + description = "Translate the window by this many pixels along the y axis"; + }; + + lines = mkOption { + type = types.nullOr types.int; + default = null; + example = 10; + description = "Number of lines"; + }; + + rowHeight = mkOption { + type = types.nullOr types.int; + default = null; + example = 1; + description = "Height of each row in chars"; + }; + + terminal = mkOption { + type = types.nullOr types.string; + default = null; + example = "${pkgs.alacritty}/bin/alacritty"; + description = "Path to terminal"; + }; + }; + + config = mkIf config.rofi.enable { + programs.rofi = { + enable = true; + + theme = config.rofi.theme; + + borderWidth = config.rofi.borderWidth; + + font = config.rofi.font; + padding = config.rofi.padding; + scrollbar = config.rofi.scrollbar; + separator = config.rofi.separator; + location = config.rofi.location; + width = config.rofi.width; + xoffset = config.rofi.xoffset; + yoffset = config.rofi.yoffset; + + lines = config.rofi.lines; + rowHeight = config.rofi.rowHeight; + + terminal = config.rofi.terminal; + + plugins = with pkgs; [ + rofi-calc + rofi-emoji + ]; + + extraConfig = { + modi = "calc,combi,drun,emoji,run,ssh"; + }; + }; + }; +} diff --git a/home/modules/xorg/xbindkeys.nix b/home/modules/xorg/xbindkeys.nix @@ -20,7 +20,7 @@ with lib; m:0x41 + c:46 # super + ; - "dmenu_run" + "rofi -show run" m:0x40 + c:47 # super + shift + alt + q diff --git a/home/profiles/laptop.nix b/home/profiles/laptop.nix @@ -23,6 +23,7 @@ in idris2.enable = true; neovim.enable = true; polybar.enable = true; + rofi.enable = true; starship.enable = true; zathura.enable = true; xbindkeys.enable = true; diff --git a/home/themes/gruvbox/default.nix b/home/themes/gruvbox/default.nix @@ -86,6 +86,8 @@ in battery-underline = yellow1; }; + rofi.theme = "gruvbox-dark-hard"; + zathura.colours = { bg = bg0_h; bg2 = bg2;