dotfiles/modules/programs/rofi/default.nix

77 lines
1.9 KiB
Nix
Raw Normal View History

2022-07-15 13:11:54 +02:00
{ config
, lib
, pkgs
, ...
}:
with lib;
let
cfg = config.my.programs.rofi;
2022-08-20 14:17:16 +02:00
rofi-bluetooth = with pkgs; stdenv.mkDerivation rec {
pname = "rofi-bluetooth";
version = "unstable-2021-03-05";
src = fetchFromGitHub {
repo = pname;
owner = "nickclyde";
# https://github.com/nickclyde/rofi-bluetooth/issues/19
rev = "893db1f2b549e7bc0e9c62e7670314349a29cdf2";
sha256 = "sha256-3oROJKEQCuSnLfbJ+JSSc9hcmJTPrLHRQJsrUcaOMss=";
};
nativeBuildInputs = [ makeWrapper ];
installPhase = ''
runHook preInstall
install -D --target-directory=$out/bin/ ./rofi-bluetooth
wrapProgram $out/bin/rofi-bluetooth \
--prefix PATH ":" ${lib.makeBinPath [ rofi-unwrapped bluez ] }
runHook postInstall
'';
meta = with lib; {
description = "Rofi-based interface to connect to bluetooth devices and display status info";
homepage = "https://github.com/nickclyde/rofi-bluetooth";
license = licenses.gpl3Only;
maintainers = with maintainers; [ MoritzBoehme ];
platforms = platforms.linux;
};
};
2022-07-15 13:11:54 +02:00
in
{
options.my.programs.rofi = {
enable = mkOption {
default = false;
type = types.bool;
example = true;
};
};
config = mkIf cfg.enable {
home-manager.users.moritz = {
programs.rofi = {
enable = true;
package =
pkgs.rofi.override { plugins = with pkgs; [ rofi-calc rofi-emoji ]; };
extraConfig = { combi-modi = "drun,window,emoji"; };
};
home.packages = with pkgs; [
(lib.mkIf config.networking.networkmanager.enable networkmanager_dmenu)
2022-08-20 14:17:16 +02:00
(lib.mkIf config.hardware.bluetooth.enable rofi-bluetooth)
2022-08-20 14:17:53 +02:00
rofi-power-menu
2022-07-15 13:11:54 +02:00
];
xdg = {
enable = true;
configFile."networkmanager-dmenu/config.ini".text = ''
[dmenu]
dmenu_command = rofi
'';
};
};
};
}