nix/lib/modules/menu.nix
2023-12-23 15:43:26 +00:00

38 lines
780 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;
};
};
}
];
};
}