1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-12-23 10:19:48 +01:00

i3,sway: break documentation dependency on configuration

Before the documentation for a number of options had a dependency on
the configuration.
This commit is contained in:
Robert Helgesson 2021-05-06 00:12:48 +02:00
parent 90dd375eba
commit f298705ae4
No known key found for this signature in database
GPG key ID: 36BDAA14C2797E89

View file

@ -79,17 +79,13 @@ let
options = let
versionAtLeast2009 = versionAtLeast config.home.stateVersion "20.09";
mkNullableOption = { type, default, ... }@args:
mkOption (args // optionalAttrs versionAtLeast2009 {
mkOption (args // {
type = types.nullOr type;
default = null;
example = default;
} // {
default = if versionAtLeast2009 then null else default;
defaultText = literalExample ''
${
if isString default then default else "See code"
} for state version < 20.09,
null for state version 20.09
null for state version 20.09, as example otherwise
'';
example = default;
});
in {
fonts = mkOption {
@ -167,11 +163,9 @@ let
"\${pkgs.waybar}/bin/waybar";
};
statusCommand = mkOption {
type = types.nullOr types.str;
default =
if versionAtLeast2009 then null else "${pkgs.i3status}/bin/i3status";
example = "i3status";
statusCommand = mkNullableOption {
type = types.str;
default = "${pkgs.i3status}/bin/i3status";
description = "Command that will be used to get status lines.";
};
@ -687,6 +681,7 @@ in {
};
}] else
[ { } ];
defaultText = literalExample "see code";
description = ''
${capitalModuleName} bars settings blocks. Set to empty list to remove bars completely.
'';