mirror of
https://github.com/nix-community/home-manager
synced 2024-11-10 21:29:48 +01:00
bemenu: add module
This commit is contained in:
parent
0e2feebb2e
commit
ce3ec36b95
8 changed files with 107 additions and 0 deletions
|
@ -317,6 +317,12 @@
|
|||
github = "nurelin";
|
||||
githubId = 5276274;
|
||||
};
|
||||
omernaveedxyz = {
|
||||
name = "Omer Naveed";
|
||||
email = "omer@omernaveed.dev";
|
||||
github = "omernaveedxyz";
|
||||
githubId = 112912585;
|
||||
};
|
||||
otavio = {
|
||||
email = "otavio.salvador@ossystems.com.br";
|
||||
github = "otavio";
|
||||
|
|
|
@ -1363,6 +1363,14 @@ in
|
|||
A new module is available: 'programs.sftpman'.
|
||||
'';
|
||||
}
|
||||
|
||||
{
|
||||
time = "2023-12-29T08:22:40+00:00";
|
||||
condition = hostPlatform.isLinux;
|
||||
message = ''
|
||||
A new module is available: 'programs.bemenu'.
|
||||
'';
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
|
@ -63,6 +63,7 @@ let
|
|||
./programs/bat.nix
|
||||
./programs/bacon.nix
|
||||
./programs/beets.nix
|
||||
./programs/bemenu.nix
|
||||
./programs/borgmatic.nix
|
||||
./programs/bottom.nix
|
||||
./programs/boxxy.nix
|
||||
|
|
52
modules/programs/bemenu.nix
Normal file
52
modules/programs/bemenu.nix
Normal file
|
@ -0,0 +1,52 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
|
||||
cfg = config.programs.bemenu;
|
||||
|
||||
in {
|
||||
meta.maintainers = [ hm.maintainers.omernaveedxyz ];
|
||||
|
||||
options.programs.bemenu = {
|
||||
enable = mkEnableOption "bemenu";
|
||||
|
||||
package = mkPackageOption pkgs "bemenu" { };
|
||||
|
||||
settings = mkOption {
|
||||
type = with types; attrsOf (oneOf [ str int 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";
|
||||
}
|
||||
'';
|
||||
description =
|
||||
"Configuration options for bemenu. See {manpage}`bemenu(1)`.";
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
assertions =
|
||||
[ (hm.assertions.assertPlatform "programs.bemenu" pkgs platforms.linux) ];
|
||||
|
||||
home.packages = [ cfg.package ];
|
||||
|
||||
home.sessionVariables = mkIf (cfg.settings != { }) {
|
||||
BEMENU_OPTS = cli.toGNUCommandLineShell { } cfg.settings;
|
||||
};
|
||||
};
|
||||
}
|
|
@ -181,6 +181,7 @@ import nmt {
|
|||
./modules/programs/autorandr
|
||||
./modules/programs/awscli
|
||||
./modules/programs/beets # One test relies on services.mpd
|
||||
./modules/programs/bemenu
|
||||
./modules/programs/borgmatic
|
||||
./modules/programs/boxxy
|
||||
./modules/programs/firefox
|
||||
|
|
26
tests/modules/programs/bemenu/basic-configuration.nix
Normal file
26
tests/modules/programs/bemenu/basic-configuration.nix
Normal file
|
@ -0,0 +1,26 @@
|
|||
{
|
||||
programs.bemenu = {
|
||||
enable = true;
|
||||
settings = {
|
||||
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";
|
||||
};
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
assertFileExists home-path/etc/profile.d/hm-session-vars.sh
|
||||
assertFileContains home-path/etc/profile.d/hm-session-vars.sh \
|
||||
"export BEMENU_OPTS=\"'--ab' '#1e1e2e' '--af' '#cdd6f4' '--fb' '#1e1e2e' '--ff' '#cdd6f4' '--hb' '#1e1e2e' '--hf' '#f9e2af' '--ignorecase' '--line-height' '28' '--nb' '#1e1e2e' '--nf' '#cdd6f4' '--prompt' 'open' '--tb' '#1e1e2e' '--tf' '#f38ba8'\""
|
||||
'';
|
||||
}
|
4
tests/modules/programs/bemenu/default.nix
Normal file
4
tests/modules/programs/bemenu/default.nix
Normal file
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
bemenu-empty-configuration = ./empty-configuration.nix;
|
||||
bemenu-basic-configuration = ./basic-configuration.nix;
|
||||
}
|
9
tests/modules/programs/bemenu/empty-configuration.nix
Normal file
9
tests/modules/programs/bemenu/empty-configuration.nix
Normal file
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
programs.bemenu = { enable = true; };
|
||||
|
||||
nmt.script = ''
|
||||
assertFileExists home-path/etc/profile.d/hm-session-vars.sh
|
||||
assertFileNotRegex home-path/etc/profile.d/hm-session-vars.sh \
|
||||
"export BEMENU_OPTS"
|
||||
'';
|
||||
}
|
Loading…
Reference in a new issue