nix/lib/modules/menu.nix

33 lines
748 B
Nix

{ user }: { lib, pkgs, config, ... }:
with lib;
let
cfg = config.programs.menu;
terminal = config.programs.terminal.package;
termcmd = "${terminal}/bin/${terminal.pname}";
in
{
options.programs = {
menu = {
enable = mkEnableOption "menu";
package = mkPackageOption pkgs "wofi" {
example = "pkgs.dmenu-wayland";
};
dmenuCommand = mkOption {
default = "/bin/wofi --show dmenu";
example = "/bin/dmenu";
};
};
};
config = mkIf cfg.enable {
home-manager.users.${user}.imports = [{
programs.wofi = mkIf (cfg.package == pkgs.wofi) {
enable = true;
settings = {
term = termcmd;
insensitive = true;
};
};
}];
};
}