fork/home-manager
git clone https://git.julia.blue/fork/home-manager
75790441
master
1{ pkgs , lib } : 2 3with lib ; 4 5let 6 7primitive = with types ; oneOf [ bool int float str ]; 8 9rule = types . submodule { 10freeformType = with types ; attrsOf primitive ; 11 12options = { 13monitor = mkOption { 14type = types . nullOr types . str ; 15default = null ; 16description = "The monitor where the rule should be applied." ; 17example = "HDMI-0" ; 18}; 19 20desktop = mkOption { 21type = types . nullOr types . str ; 22default = null ; 23description = "The desktop where the rule should be applied." ; 24example = "^8" ; 25}; 26 27node = mkOption { 28type = types . nullOr types . str ; 29default = null ; 30description = "The node where the rule should be applied." ; 31example = "1" ; 32}; 33 34state = mkOption { 35type = types . nullOr 36( types . enum [ "tiled" "pseudo_tiled" "floating" "fullscreen" ]); 37default = null ; 38description = "The state in which a new window should spawn." ; 39example = "floating" ; 40}; 41 42layer = mkOption { 43type = types . nullOr ( types . enum [ "below" "normal" "above" ]); 44default = null ; 45description = "The layer where a new window should spawn." ; 46example = "above" ; 47}; 48 49splitDir = mkOption { 50type = types . nullOr ( types . enum [ "north" "west" "south" "east" ]); 51default = null ; 52description = "The direction where the container is going to be split." ; 53example = "south" ; 54}; 55 56splitRatio = mkOption { 57type = types . nullOr types . float ; 58default = null ; 59description = '' 60The ratio between the new window and the previous existing window in 61the desktop. 62'' ; 63example = 0.65 ; 64}; 65 66hidden = mkOption { 67type = types . nullOr types . bool ; 68default = null ; 69description = "Whether the node should occupy any space." ; 70example = true ; 71}; 72 73sticky = mkOption { 74type = types . nullOr types . bool ; 75default = null ; 76description = "Whether the node should stay on the focused desktop." ; 77example = true ; 78}; 79 80private = mkOption { 81type = types . nullOr types . bool ; 82default = null ; 83description = '' 84Whether the node should stay in the same tiling position and size. 85'' ; 86example = true ; 87}; 88 89locked = mkOption { 90type = types . nullOr types . bool ; 91default = null ; 92description = '' 93Whether the node should ignore {command}`node --close` 94messages. 95'' ; 96example = true ; 97}; 98 99marked = mkOption { 100type = types . nullOr types . bool ; 101default = null ; 102description = "Whether the node will be marked for deferred actions." ; 103example = true ; 104}; 105 106center = mkOption { 107type = types . nullOr types . bool ; 108default = null ; 109description = '' 110Whether the node will be put in the center, in floating mode. 111'' ; 112example = true ; 113}; 114 115follow = mkOption { 116type = types . nullOr types . bool ; 117default = null ; 118description = "Whether focus should follow the node when it is moved." ; 119example = true ; 120}; 121 122manage = mkOption { 123type = types . nullOr types . bool ; 124default = null ; 125description = '' 126Whether the window should be managed by bspwm. If false, the window 127will be ignored by bspwm entirely. This is useful for overlay apps, 128e.g. screenshot tools. 129'' ; 130example = true ; 131}; 132 133focus = mkOption { 134type = types . nullOr types . bool ; 135default = null ; 136description = "Whether the node should gain focus on creation." ; 137example = true ; 138}; 139 140border = mkOption { 141type = types . nullOr types . bool ; 142default = null ; 143description = "Whether the node should have border." ; 144example = true ; 145}; 146 147rectangle = mkOption { 148type = types . nullOr types . str ; 149default = null ; 150description = "The node's geometry, in the format `WxH+X+Y`." ; 151example = "800x600+32+32" ; 152}; 153}; 154}; 155 156in { 157xsession . windowManager . bspwm = { 158enable = mkEnableOption "bspwm window manager" ; 159 160package = mkOption { 161type = types . package ; 162default = pkgs . bspwm ; 163defaultText = literalExpression "pkgs.bspwm" ; 164description = "The bspwm package to use." ; 165example = literalExpression "pkgs.bspwm-unstable" ; 166}; 167 168settings = mkOption { 169type = with types ; attrsOf ( either primitive ( listOf primitive )); 170default = { }; 171description = "General settings given to `bspc config`." ; 172example = { 173"border_width" = 2 ; 174"split_ratio" = 0.52 ; 175"gapless_monocle" = true ; 176}; 177}; 178 179extraConfig = mkOption { 180type = types . lines ; 181default = "" ; 182description = 183"Additional shell commands to be run at the end of the config file." ; 184example = '' 185bspc subscribe all > ~/bspc-report.log & 186'' ; 187}; 188 189extraConfigEarly = mkOption { 190type = types . lines ; 191default = "" ; 192description = 193"Like extraConfig, except commands are run at the start of the config file." ; 194}; 195 196monitors = mkOption { 197type = types . attrsOf ( types . listOf types . str ); 198default = { }; 199description = 200"Specifies the names of desktops to create on each monitor." ; 201example = { "HDMI-0" = [ "web" "terminal" "III" "IV" ]; }; 202}; 203 204alwaysResetDesktops = mkOption { 205type = types . bool ; 206default = true ; 207description = '' 208If set to `true`, desktops configured in {option}`monitors` will be reset 209every time the config is run. 210 211If set to `false`, desktops will only be configured the first time the config is run. 212This is useful if you want to dynamically add desktops and you don't want them to be destroyed if you 213re-run `bspwmrc`. 214'' ; 215}; 216 217rules = mkOption { 218type = types . attrsOf rule ; 219default = { }; 220description = 221"Rule configuration. The keys of the attribute set are the targets of the rules." ; 222example = literalExpression '' 223{ 224"Gimp" = { 225desktop = "^8"; 226state = "floating"; 227follow = true; 228}; 229"Kupfer.py" = { 230focus = true; 231}; 232"Screenkey" = { 233manage = false; 234}; 235} 236'' ; 237}; 238 239startupPrograms = mkOption { 240type = types . listOf types . str ; 241default = [ ]; 242description = "Programs to be executed during startup." ; 243example = [ "numlockx on" "tilda" ]; 244}; 245}; 246}