Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

literalExample -> literalExpression #2371

Merged
merged 2 commits into from
Oct 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions modules/home-environment.nix
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ let
if versionAtLeast config.home.stateVersion "19.09"
then null
else "us";
defaultText = literalExample "null";
defaultText = literalExpression "null";
description = ''
Keyboard layout. If <literal>null</literal>, then the system
configuration will be used.
Expand Down Expand Up @@ -149,7 +149,7 @@ let
if versionAtLeast config.home.stateVersion "19.09"
then null
else "";
defaultText = literalExample "null";
defaultText = literalExpression "null";
example = "colemak";
description = ''
X keyboard variant. If <literal>null</literal>, then the
Expand Down Expand Up @@ -182,7 +182,7 @@ in
options = {
home.username = mkOption {
type = types.str;
defaultText = literalExample ''
defaultText = literalExpression ''
"$USER" for state version < 20.09,
undefined for state version ≥ 20.09
'';
Expand All @@ -192,7 +192,7 @@ in

home.homeDirectory = mkOption {
type = types.path;
defaultText = literalExample ''
defaultText = literalExpression ''
"$HOME" for state version < 20.09,
undefined for state version ≥ 20.09
'';
Expand Down Expand Up @@ -321,7 +321,7 @@ in
home.activation = mkOption {
type = hm.types.dagOf types.str;
default = {};
example = literalExample ''
example = literalExpression ''
{
myActivationAction = lib.hm.dag.entryAfter ["writeBoundary"] '''
$DRY_RUN_CMD ln -s $VERBOSE_ARG \
Expand Down
2 changes: 1 addition & 1 deletion modules/i18n/input-method/fcitx.nix
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ in {
engines = mkOption {
type = with types; listOf fcitxEngine;
default = [ ];
example = literalExample "with pkgs.fcitx-engines; [ mozc hangul ]";
example = literalExpression "with pkgs.fcitx-engines; [ mozc hangul ]";
description = let
enginesDrv = filterAttrs (const isDerivation) pkgs.fcitx-engines;
engines = concatStringsSep ", "
Expand Down
2 changes: 1 addition & 1 deletion modules/i18n/input-method/fcitx5.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ in {
addons = mkOption {
type = with types; listOf package;
default = [ ];
example = literalExample "with pkgs; [ fcitx5-rime ]";
example = literalExpression "with pkgs; [ fcitx5-rime ]";
description = ''
Enabled Fcitx5 addons.
'';
Expand Down
2 changes: 1 addition & 1 deletion modules/i18n/input-method/kime.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ in {
config = mkOption {
type = yamlFormat.type;
default = { };
example = literalExample ''
example = literalExpression ''
{
daemon = {
modules = ["Xim" "Indicator"];
Expand Down
2 changes: 1 addition & 1 deletion modules/lib/file-type.nix
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ with lib;
absPath = if hasPrefix "/" p then p else "${basePath}/${p}";
in
removePrefix (homeDirectory + "/") absPath;
defaultText = literalExample "<name>";
defaultText = literalExpression "<name>";
description = ''
Path to target file relative to ${basePathDesc}.
'';
Expand Down
8 changes: 7 additions & 1 deletion modules/lib/stdlib-extended.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,10 @@
nixpkgsLib:

let mkHmLib = import ./.;
in nixpkgsLib.extend (self: super: { hm = mkHmLib { lib = super; }; })
in nixpkgsLib.extend (self: super: {
hm = mkHmLib { lib = self; };

# For forward compatibility.
literalExpression = super.literalExpression or super.literalExample;
literalDocBook = super.literalDocBook or super.literalExample;
})
2 changes: 1 addition & 1 deletion modules/lib/types.nix
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ in rec {
package = mkOption {
type = types.nullOr types.package;
default = null;
example = literalExample "pkgs.dejavu_fonts";
example = literalExpression "pkgs.dejavu_fonts";
description = ''
Package providing the font. This package will be installed
to your profile. If <literal>null</literal> then the font
Expand Down
2 changes: 1 addition & 1 deletion modules/misc/dconf.nix
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ in {
settings = mkOption {
type = with types; attrsOf (attrsOf hm.types.gvariant);
default = { };
example = literalExample ''
example = literalExpression ''
{
"org/gnome/calculator" = {
button-mode = "programming";
Expand Down
6 changes: 3 additions & 3 deletions modules/misc/gtk.nix
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ let
package = mkOption {
type = types.nullOr types.package;
default = null;
example = literalExample "pkgs.gnome.gnome_themes_standard";
example = literalExpression "pkgs.gnome.gnome_themes_standard";
description = ''
Package providing the theme. This package will be installed
to your profile. If <literal>null</literal> then the theme
Expand Down Expand Up @@ -97,9 +97,9 @@ in {
type = types.path;
default = "${config.home.homeDirectory}/.gtkrc-2.0";
defaultText =
literalExample ''"''${config.home.homeDirectory}/.gtkrc-2.0"'';
literalExpression ''"''${config.home.homeDirectory}/.gtkrc-2.0"'';
example =
literalExample ''"''${config.xdg.configHome}/gtk-2.0/gtkrc"'';
literalExpression ''"''${config.xdg.configHome}/gtk-2.0/gtkrc"'';
description = ''
The location to put the GTK configuration file.
'';
Expand Down
2 changes: 1 addition & 1 deletion modules/misc/nixpkgs.nix
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ in {

overlays = mkOption {
default = null;
example = literalExample ''
example = literalExpression ''
[ (self: super: {
openssh = super.openssh.override {
hpnSupport = true;
Expand Down
2 changes: 1 addition & 1 deletion modules/misc/qt.nix
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ in {
package = mkOption {
type = types.nullOr types.package;
default = null;
example = literalExample "pkgs.adwaita-qt";
example = literalExpression "pkgs.adwaita-qt";
description = "Theme package to be used in Qt5 applications.";
};
};
Expand Down
4 changes: 2 additions & 2 deletions modules/misc/xdg-desktop-entries.nix
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ let
This may override other values.
'';
default = { };
example = literalExample ''
example = literalExpression ''
{
Keywords = "calc;math";
DBusActivatable = "false";
Expand Down Expand Up @@ -157,7 +157,7 @@ in {
'';
default = { };
type = types.attrsOf (types.submodule desktopEntry);
example = literalExample ''
example = literalExpression ''
{
firefox = {
name = "Firefox";
Expand Down
4 changes: 2 additions & 2 deletions modules/misc/xdg-mime-apps.nix
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ in {
associations.added = mkOption {
type = types.attrsOf strListOrSingleton;
default = { };
example = literalExample ''
example = literalExpression ''
{
"mimetype1" = [ "foo1.desktop" "foo2.desktop" "foo3.desktop" ];
"mimetype2" = "foo4.desktop";
Expand All @@ -57,7 +57,7 @@ in {
defaultApplications = mkOption {
type = types.attrsOf strListOrSingleton;
default = { };
example = literalExample ''
example = literalExpression ''
{
"mimetype1" = [ "default1.desktop" "default2.desktop" ];
}
Expand Down
2 changes: 1 addition & 1 deletion modules/misc/xdg-mime.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ in {
type = types.bool;
default = pkgs.hostPlatform.isLinux;
defaultText =
literalExample "true if host platform is Linux, false otherwise";
literalExpression "true if host platform is Linux, false otherwise";
description = ''
Whether to install programs and files to support the
XDG Shared MIME-info specification and XDG MIME Applications
Expand Down
4 changes: 2 additions & 2 deletions modules/misc/xdg-system-dirs.nix
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ in {
config = mkOption {
type = types.listOf types.str;
default = [ ];
example = literalExample ''[ "/etc/xdg" ]'';
example = literalExpression ''[ "/etc/xdg" ]'';
description = ''
Directory names to add to <envar>XDG_CONFIG_DIRS</envar>
in the user session.
Expand All @@ -27,7 +27,7 @@ in {
data = mkOption {
type = types.listOf types.str;
default = [ ];
example = literalExample ''[ "/usr/share" "/usr/local/share" ]'';
example = literalExpression ''[ "/usr/share" "/usr/local/share" ]'';
description = ''
Directory names to add to <envar>XDG_DATA_DIRS</envar>
in the user session.
Expand Down
4 changes: 2 additions & 2 deletions modules/programs/alacritty.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ in {
package = mkOption {
type = types.package;
default = pkgs.alacritty;
defaultText = literalExample "pkgs.alacritty";
defaultText = literalExpression "pkgs.alacritty";
description = "The Alacritty package to install.";
};

settings = mkOption {
type = yamlFormat.type;
default = { };
example = literalExample ''
example = literalExpression ''
{
window.dimensions = {
lines = 3;
Expand Down
2 changes: 1 addition & 1 deletion modules/programs/alot-accounts.nix
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ with lib;
+ "}[,\\]]?'";
shellcommand_external_filtering = "False";
};
example = literalExample ''
example = literalExpression ''
{
type = "shellcommand";
command = "abook --mutt-query";
Expand Down
2 changes: 1 addition & 1 deletion modules/programs/alot.nix
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ in {
handle_mouse = true;
prefer_plaintext = true;
};
example = literalExample ''
example = literalExpression ''
{
auto_remove_unread = true;
ask_subject = false;
Expand Down
2 changes: 1 addition & 1 deletion modules/programs/aria2.nix
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ in {
</citerefentry>
for options.
'';
example = literalExample ''
example = literalExpression ''
{
listen-port = 60000;
dht-listen-port = 60000;
Expand Down
2 changes: 1 addition & 1 deletion modules/programs/astroid.nix
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ in {
extraConfig = mkOption {
type = jsonFormat.type;
default = { };
example = literalExample ''
example = literalExpression ''
{
poll.interval = 0;
}
Expand Down
4 changes: 2 additions & 2 deletions modules/programs/atuin.nix
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ in {
package = mkOption {
type = types.package;
default = pkgs.atuin;
defaultText = literalExample "pkgs.atuin";
defaultText = literalExpression "pkgs.atuin";
description = "The package to use for atuin.";
};

Expand Down Expand Up @@ -50,7 +50,7 @@ in {
entries = entryOrAttrsOf (entryOrAttrsOf entry);
in attrsOf entries // { description = "Atuin configuration"; };
default = { };
example = literalExample ''
example = literalExpression ''
{
auto_sync = true;
sync_frequency = "5m";
Expand Down
8 changes: 4 additions & 4 deletions modules/programs/autorandr.nix
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ let
transform = mkOption {
type = types.nullOr (matrixOf 3 3 types.float);
default = null;
example = literalExample ''
example = literalExpression ''
[
[ 0.6 0.0 0.0 ]
[ 0.0 0.6 0.0 ]
Expand Down Expand Up @@ -169,7 +169,7 @@ let
exclusive.
'';
default = null;
example = literalExample ''
example = literalExpression ''
{
x = 1.25;
y = 1.25;
Expand Down Expand Up @@ -280,7 +280,7 @@ in {
type = globalHooksModule;
description = "Global hook scripts";
default = { };
example = literalExample ''
example = literalExpression ''
{
postswitch = {
"notify-i3" = "''${pkgs.i3}/bin/i3-msg restart";
Expand Down Expand Up @@ -312,7 +312,7 @@ in {
type = types.attrsOf profileModule;
description = "Autorandr profiles specification.";
default = { };
example = literalExample ''
example = literalExpression ''
{
"work" = {
fingerprint = {
Expand Down
2 changes: 1 addition & 1 deletion modules/programs/bash.nix
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ in
shellAliases = mkOption {
default = {};
type = types.attrsOf types.str;
example = literalExample ''
example = literalExpression ''
{
ll = "ls -l";
".." = "cd ..";
Expand Down
2 changes: 1 addition & 1 deletion modules/programs/bat.nix
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ in {
themes = mkOption {
type = types.attrsOf types.lines;
default = { };
example = literalExample ''
example = literalExpression ''
{
dracula = builtins.readFile (pkgs.fetchFromGitHub {
owner = "dracula";
Expand Down
4 changes: 2 additions & 2 deletions modules/programs/beets.nix
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ in {
package = mkOption {
type = types.package;
default = pkgs.beets;
defaultText = literalExample "pkgs.beets";
defaultText = literalExpression "pkgs.beets";
example =
literalExample "(pkgs.beets.override { enableCheck = true; })";
literalExpression "(pkgs.beets.override { enableCheck = true; })";
description = ''
The <literal>beets</literal> package to use.
Can be used to specify extensions.
Expand Down
4 changes: 2 additions & 2 deletions modules/programs/bottom.nix
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ in {
package = mkOption {
type = types.package;
default = pkgs.bottom;
defaultText = literalExample "pkgs.bottom";
defaultText = literalExpression "pkgs.bottom";
description = "Package providing <command>bottom</command>.";
};

Expand All @@ -38,7 +38,7 @@ in {
See <link xlink:href="https://github.com/ClementTsang/bottom/blob/master/sample_configs/default_config.toml"/>
for the default configuration.
'';
example = literalExample ''
example = literalExpression ''
{
flags = {
avg_cpu = true;
Expand Down
6 changes: 3 additions & 3 deletions modules/programs/broot.nix
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ in {
execution = "less {file}";
}
];
example = literalExample ''
example = literalExpression ''
[
{ invocation = "p"; execution = ":parent"; }
{ invocation = "edit"; shortcut = "e"; execution = "$EDITOR {file}" ; }
Expand Down Expand Up @@ -124,14 +124,14 @@ in {
package = mkOption {
type = types.package;
default = pkgs.broot;
defaultText = literalExample "pkgs.broot";
defaultText = literalExpression "pkgs.broot";
description = "Package providing broot";
};

skin = mkOption {
type = types.attrsOf types.str;
default = { };
example = literalExample ''
example = literalExpression ''
{
status_normal_fg = "grayscale(18)";
status_normal_bg = "grayscale(3)";
Expand Down
Loading