mirror of
https://github.com/nix-community/home-manager
synced 2024-12-03 08:29:46 +01:00
36a53d9f26
This process was automated by [my fork of `nix-doc-munge`]. All conversions were automatically checked to produce the same DocBook result when converted back, modulo minor typographical/formatting differences on the acceptable-to-desirable spectrum. To reproduce this commit, run: $ NIX_PATH=nixpkgs=flake:nixpkgs/e7e69199f0372364a6106a1e735f68604f4c5a25 \ nix shell nixpkgs#coreutils \ -c find . -name '*.nix' \ -exec nix run -- github:emilazy/nix-doc-munge/98dadf1f77351c2ba5dcb709a2a171d655f15099 \ {} + $ ./format [my fork of `nix-doc-munge`]: https://github.com/emilazy/nix-doc-munge/tree/home-manager
251 lines
7 KiB
Nix
251 lines
7 KiB
Nix
{ pkgs, lib }:
|
|
|
|
with lib;
|
|
|
|
let
|
|
|
|
primitive = with types; oneOf [ bool int float str ];
|
|
|
|
rule = types.submodule {
|
|
freeformType = with types; attrsOf primitive;
|
|
|
|
options = {
|
|
monitor = mkOption {
|
|
type = types.nullOr types.str;
|
|
default = null;
|
|
description = lib.mdDoc "The monitor where the rule should be applied.";
|
|
example = "HDMI-0";
|
|
};
|
|
|
|
desktop = mkOption {
|
|
type = types.nullOr types.str;
|
|
default = null;
|
|
description = lib.mdDoc "The desktop where the rule should be applied.";
|
|
example = "^8";
|
|
};
|
|
|
|
node = mkOption {
|
|
type = types.nullOr types.str;
|
|
default = null;
|
|
description = lib.mdDoc "The node where the rule should be applied.";
|
|
example = "1";
|
|
};
|
|
|
|
state = mkOption {
|
|
type = types.nullOr
|
|
(types.enum [ "tiled" "pseudo_tiled" "floating" "fullscreen" ]);
|
|
default = null;
|
|
description = lib.mdDoc "The state in which a new window should spawn.";
|
|
example = "floating";
|
|
};
|
|
|
|
layer = mkOption {
|
|
type = types.nullOr (types.enum [ "below" "normal" "above" ]);
|
|
default = null;
|
|
description = lib.mdDoc "The layer where a new window should spawn.";
|
|
example = "above";
|
|
};
|
|
|
|
splitDir = mkOption {
|
|
type = types.nullOr (types.enum [ "north" "west" "south" "east" ]);
|
|
default = null;
|
|
description =
|
|
lib.mdDoc "The direction where the container is going to be split.";
|
|
example = "south";
|
|
};
|
|
|
|
splitRatio = mkOption {
|
|
type = types.nullOr types.float;
|
|
default = null;
|
|
description = lib.mdDoc ''
|
|
The ratio between the new window and the previous existing window in
|
|
the desktop.
|
|
'';
|
|
example = 0.65;
|
|
};
|
|
|
|
hidden = mkOption {
|
|
type = types.nullOr types.bool;
|
|
default = null;
|
|
description = lib.mdDoc "Whether the node should occupy any space.";
|
|
example = true;
|
|
};
|
|
|
|
sticky = mkOption {
|
|
type = types.nullOr types.bool;
|
|
default = null;
|
|
description =
|
|
lib.mdDoc "Whether the node should stay on the focused desktop.";
|
|
example = true;
|
|
};
|
|
|
|
private = mkOption {
|
|
type = types.nullOr types.bool;
|
|
default = null;
|
|
description = lib.mdDoc ''
|
|
Whether the node should stay in the same tiling position and size.
|
|
'';
|
|
example = true;
|
|
};
|
|
|
|
locked = mkOption {
|
|
type = types.nullOr types.bool;
|
|
default = null;
|
|
description = lib.mdDoc ''
|
|
Whether the node should ignore {command}`node --close`
|
|
messages.
|
|
'';
|
|
example = true;
|
|
};
|
|
|
|
marked = mkOption {
|
|
type = types.nullOr types.bool;
|
|
default = null;
|
|
description =
|
|
lib.mdDoc "Whether the node will be marked for deferred actions.";
|
|
example = true;
|
|
};
|
|
|
|
center = mkOption {
|
|
type = types.nullOr types.bool;
|
|
default = null;
|
|
description = lib.mdDoc ''
|
|
Whether the node will be put in the center, in floating mode.
|
|
'';
|
|
example = true;
|
|
};
|
|
|
|
follow = mkOption {
|
|
type = types.nullOr types.bool;
|
|
default = null;
|
|
description =
|
|
lib.mdDoc "Whether focus should follow the node when it is moved.";
|
|
example = true;
|
|
};
|
|
|
|
manage = mkOption {
|
|
type = types.nullOr types.bool;
|
|
default = null;
|
|
description = lib.mdDoc ''
|
|
Whether the window should be managed by bspwm. If false, the window
|
|
will be ignored by bspwm entirely. This is useful for overlay apps,
|
|
e.g. screenshot tools.
|
|
'';
|
|
example = true;
|
|
};
|
|
|
|
focus = mkOption {
|
|
type = types.nullOr types.bool;
|
|
default = null;
|
|
description =
|
|
lib.mdDoc "Whether the node should gain focus on creation.";
|
|
example = true;
|
|
};
|
|
|
|
border = mkOption {
|
|
type = types.nullOr types.bool;
|
|
default = null;
|
|
description = lib.mdDoc "Whether the node should have border.";
|
|
example = true;
|
|
};
|
|
|
|
rectangle = mkOption {
|
|
type = types.nullOr types.str;
|
|
default = null;
|
|
description = lib.mdDoc "The node's geometry, in the format `WxH+X+Y`.";
|
|
example = "800x600+32+32";
|
|
};
|
|
};
|
|
};
|
|
|
|
in {
|
|
xsession.windowManager.bspwm = {
|
|
enable = mkEnableOption (lib.mdDoc "bspwm window manager");
|
|
|
|
package = mkOption {
|
|
type = types.package;
|
|
default = pkgs.bspwm;
|
|
defaultText = literalExpression "pkgs.bspwm";
|
|
description = lib.mdDoc "The bspwm package to use.";
|
|
example = literalExpression "pkgs.bspwm-unstable";
|
|
};
|
|
|
|
settings = mkOption {
|
|
type = with types; attrsOf (either primitive (listOf primitive));
|
|
default = { };
|
|
description = lib.mdDoc "General settings given to `bspc config`.";
|
|
example = {
|
|
"border_width" = 2;
|
|
"split_ratio" = 0.52;
|
|
"gapless_monocle" = true;
|
|
};
|
|
};
|
|
|
|
extraConfig = mkOption {
|
|
type = types.lines;
|
|
default = "";
|
|
description = lib.mdDoc
|
|
"Additional shell commands to be run at the end of the config file.";
|
|
example = ''
|
|
bspc subscribe all > ~/bspc-report.log &
|
|
'';
|
|
};
|
|
|
|
extraConfigEarly = mkOption {
|
|
type = types.lines;
|
|
default = "";
|
|
description = lib.mdDoc
|
|
"Like extraConfig, except commands are run at the start of the config file.";
|
|
};
|
|
|
|
monitors = mkOption {
|
|
type = types.attrsOf (types.listOf types.str);
|
|
default = { };
|
|
description =
|
|
lib.mdDoc "Specifies the names of desktops to create on each monitor.";
|
|
example = { "HDMI-0" = [ "web" "terminal" "III" "IV" ]; };
|
|
};
|
|
|
|
alwaysResetDesktops = mkOption {
|
|
type = types.bool;
|
|
default = true;
|
|
description = lib.mdDoc ''
|
|
If set to `true`, desktops configured in {option}`monitors` will be reset
|
|
every time the config is run.
|
|
|
|
If set to `false`, desktops will only be configured the first time the config is run.
|
|
This is useful if you want to dynamically add desktops and you don't want them to be destroyed if you
|
|
re-run `bspwmrc`.
|
|
'';
|
|
};
|
|
|
|
rules = mkOption {
|
|
type = types.attrsOf rule;
|
|
default = { };
|
|
description = lib.mdDoc
|
|
"Rule configuration. The keys of the attribute set are the targets of the rules.";
|
|
example = literalExpression ''
|
|
{
|
|
"Gimp" = {
|
|
desktop = "^8";
|
|
state = "floating";
|
|
follow = true;
|
|
};
|
|
"Kupfer.py" = {
|
|
focus = true;
|
|
};
|
|
"Screenkey" = {
|
|
manage = false;
|
|
};
|
|
}
|
|
'';
|
|
};
|
|
|
|
startupPrograms = mkOption {
|
|
type = types.listOf types.str;
|
|
default = [ ];
|
|
description = lib.mdDoc "Programs to be executed during startup.";
|
|
example = [ "numlockx on" "tilda" ];
|
|
};
|
|
};
|
|
}
|