1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-11-08 19:46:05 +01:00
home-manager/modules/services/window-managers/fluxbox.nix
Austin Horstman 86402a17b6 treewide: flatten single file modules
Some files don't need nesting and can be root level again to reduce
conflicts with other PRs.

Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
2025-06-23 16:20:26 -05:00

119 lines
3.2 KiB
Nix

{
config,
lib,
pkgs,
...
}:
let
inherit (lib) mkIf mkOption types;
cfg = config.xsession.windowManager.fluxbox;
in
{
meta.maintainers = [ lib.maintainers.AndersonTorres ];
options = {
xsession.windowManager.fluxbox = {
enable = lib.mkEnableOption "Fluxbox window manager";
package = lib.mkPackageOption pkgs "fluxbox" { nullable = true; };
init = mkOption {
type = types.lines;
default = "";
description = ''
Init configuration for Fluxbox, written to
{file}`~/.fluxbox/init`. Look at the
{manpage}`fluxbox(1)` manpage for details.
'';
};
apps = mkOption {
type = types.lines;
default = "";
description = ''
Apps configuration for Fluxbox, written to
{file}`~/.fluxbox/apps`. Look at the
{manpage}`fluxbox(1)` manpage for details.
'';
};
keys = mkOption {
type = types.lines;
default = "";
description = ''
Keyboard shortcuts configuration for Fluxbox, written to
{file}`~/.fluxbox/keys`. Look at the
{manpage}`fluxbox-keys(1)` manpage for details.
'';
};
menu = mkOption {
type = types.lines;
default = "";
description = ''
Menu configuration for Fluxbox, written to
{file}`~/.fluxbox/menu`. Look at the
{manpage}`fluxbox-menu(1)` manpage for details.
'';
};
slitlist = mkOption {
type = types.lines;
default = "";
description = ''
Slitlist configuration for Fluxbox, written to
{file}`~/.fluxbox/slitlist`. Look at the
{manpage}`fluxbox(1)` manpage for details.
'';
};
windowmenu = mkOption {
type = types.lines;
default = "";
description = ''
Window menu configuration for Fluxbox, written to
{file}`~/.fluxbox/windowmenu`. Look at the
{manpage}`fluxbox-menu(1)`
manpage for details.
'';
};
extraCommandLineArgs = mkOption {
type = with types; listOf str;
default = [ ];
example = [
"-log"
"/tmp/fluxbox.log"
];
description = ''
Extra command line arguments to pass to {command}`fluxbox`.
Look at the
{manpage}`fluxbox(1)` manpage for details.
'';
};
};
};
config = mkIf cfg.enable {
assertions = [
(lib.hm.assertions.assertPlatform "xsession.windowManager.fluxbox" pkgs lib.platforms.linux)
];
home.packages = lib.mkIf (cfg.package != null) [ cfg.package ];
home.file = {
".fluxbox/init" = mkIf (cfg.init != "") { text = cfg.init; };
".fluxbox/apps" = mkIf (cfg.apps != "") { text = cfg.apps; };
".fluxbox/keys" = mkIf (cfg.keys != "") { text = cfg.keys; };
".fluxbox/menu" = mkIf (cfg.menu != "") { text = cfg.menu; };
".fluxbox/slitlist" = mkIf (cfg.slitlist != "") { text = cfg.slitlist; };
".fluxbox/windowmenu" = mkIf (cfg.windowmenu != "") { text = cfg.windowmenu; };
};
xsession.windowManager.command = lib.escapeShellArgs (
[ "${cfg.package}/bin/fluxbox" ] ++ lib.remove "" cfg.extraCommandLineArgs
);
};
}