fork/home-manager

git clone https://git.julia.blue/fork/home-manager

ykis-0-0fluxbox: fix xsession commandf5b920f4

master
3.1 KiB113 linesraw
1{ config, lib, pkgs, ... }:
2
3with lib;
4
5let
6
7  cfg = config.xsession.windowManager.fluxbox;
8
9in {
10  meta.maintainers = [ maintainers.AndersonTorres ];
11
12  options = {
13    xsession.windowManager.fluxbox = {
14      enable = mkEnableOption "Fluxbox window manager";
15
16      package = mkPackageOption pkgs "fluxbox" { };
17
18      init = mkOption {
19        type = types.lines;
20        default = "";
21        description = ''
22          Init configuration for Fluxbox, written to
23          {file}`~/.fluxbox/init`. Look at the
24          {manpage}`fluxbox(1)` manpage for details.
25        '';
26      };
27
28      apps = mkOption {
29        type = types.lines;
30        default = "";
31        description = ''
32          Apps configuration for Fluxbox, written to
33          {file}`~/.fluxbox/apps`. Look at the
34          {manpage}`fluxbox(1)` manpage for details.
35        '';
36      };
37
38      keys = mkOption {
39        type = types.lines;
40        default = "";
41        description = ''
42          Keyboard shortcuts configuration for Fluxbox, written to
43          {file}`~/.fluxbox/keys`. Look at the
44          {manpage}`fluxbox-keys(1)` manpage for details.
45        '';
46      };
47
48      menu = mkOption {
49        type = types.lines;
50        default = "";
51        description = ''
52          Menu configuration for Fluxbox, written to
53          {file}`~/.fluxbox/menu`. Look at the
54          {manpage}`fluxbox-menu(1)` manpage for details.
55        '';
56      };
57
58      slitlist = mkOption {
59        type = types.lines;
60        default = "";
61        description = ''
62          Slitlist configuration for Fluxbox, written to
63          {file}`~/.fluxbox/slitlist`. Look at the
64          {manpage}`fluxbox(1)` manpage for details.
65        '';
66      };
67
68      windowmenu = mkOption {
69        type = types.lines;
70        default = "";
71        description = ''
72          Window menu configuration for Fluxbox, written to
73          {file}`~/.fluxbox/windowmenu`. Look at the
74          {manpage}`fluxbox-menu(1)`
75          manpage for details.
76        '';
77      };
78
79      extraCommandLineArgs = mkOption {
80        type = with types; listOf str;
81        default = [ ];
82        example = [ "-log" "/tmp/fluxbox.log" ];
83        description = ''
84          Extra command line arguments to pass to {command}`fluxbox`.
85          Look at the
86          {manpage}`fluxbox(1)` manpage for details.
87        '';
88      };
89    };
90  };
91
92  config = mkIf cfg.enable {
93    assertions = [
94      (hm.assertions.assertPlatform "xsession.windowManager.fluxbox" pkgs
95        platforms.linux)
96    ];
97
98    home.packages = [ cfg.package ];
99
100    home.file = {
101      ".fluxbox/init" = mkIf (cfg.init != "") { text = cfg.init; };
102      ".fluxbox/apps" = mkIf (cfg.apps != "") { text = cfg.apps; };
103      ".fluxbox/keys" = mkIf (cfg.keys != "") { text = cfg.keys; };
104      ".fluxbox/menu" = mkIf (cfg.menu != "") { text = cfg.menu; };
105      ".fluxbox/slitlist" = mkIf (cfg.slitlist != "") { text = cfg.slitlist; };
106      ".fluxbox/windowmenu" =
107        mkIf (cfg.windowmenu != "") { text = cfg.windowmenu; };
108    };
109
110    xsession.windowManager.command = escapeShellArgs
111      ([ "${cfg.package}/bin/fluxbox" ] ++ remove "" cfg.extraCommandLineArgs);
112  };
113}