mirror of
https://github.com/nix-community/home-manager.git
synced 2025-03-18 22:33:00 +00:00
Can generate the config without installing application through home-manager. Helpful when a package is broken (or not provided) on a specific platform through nixpkgs and needs to be installed through other means but you still can benefit from the declarative configuration.
53 lines
1.2 KiB
Nix
53 lines
1.2 KiB
Nix
{ config, lib, pkgs, ... }:
|
|
|
|
with lib;
|
|
|
|
let
|
|
|
|
cfg = config.programs.bemenu;
|
|
|
|
in {
|
|
meta.maintainers = [ ];
|
|
|
|
options.programs.bemenu = {
|
|
enable = mkEnableOption "bemenu";
|
|
|
|
package = mkPackageOption pkgs "bemenu" { nullable = true; };
|
|
|
|
settings = mkOption {
|
|
type = with types; attrsOf (oneOf [ str number bool ]);
|
|
default = { };
|
|
example = literalExpression ''
|
|
{
|
|
line-height = 28;
|
|
prompt = "open";
|
|
ignorecase = true;
|
|
fb = "#1e1e2e";
|
|
ff = "#cdd6f4";
|
|
nb = "#1e1e2e";
|
|
nf = "#cdd6f4";
|
|
tb = "#1e1e2e";
|
|
hb = "#1e1e2e";
|
|
tf = "#f38ba8";
|
|
hf = "#f9e2af";
|
|
af = "#cdd6f4";
|
|
ab = "#1e1e2e";
|
|
width-factor = 0.3;
|
|
}
|
|
'';
|
|
description =
|
|
"Configuration options for bemenu. See {manpage}`bemenu(1)`.";
|
|
};
|
|
};
|
|
|
|
config = mkIf cfg.enable {
|
|
assertions =
|
|
[ (hm.assertions.assertPlatform "programs.bemenu" pkgs platforms.linux) ];
|
|
|
|
home.packages = lib.mkIf (cfg.package != null) [ cfg.package ];
|
|
|
|
home.sessionVariables = mkIf (cfg.settings != { }) {
|
|
BEMENU_OPTS = cli.toGNUCommandLineShell { } cfg.settings;
|
|
};
|
|
};
|
|
}
|