1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-11-08 19:46:05 +01:00

treewide: Remove unwanted dependencies (#7487)

Fixes interpolation of packages in the default and example texts.
This commit is contained in:
Tom Hubrecht 2025-07-17 21:12:50 +02:00 committed by GitHub
parent 460f1e9af9
commit 8eb2f2a26a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 50 additions and 18 deletions

View file

@ -23,6 +23,15 @@ in
"'\\[?{" + ''"name": "(?P<name>.*)", "address": "(?P<email>.+)", "name-addr": ".*"'' + "}[,\\]]?'"; "'\\[?{" + ''"name": "(?P<name>.*)", "address": "(?P<email>.+)", "name-addr": ".*"'' + "}[,\\]]?'";
shellcommand_external_filtering = "False"; shellcommand_external_filtering = "False";
}; };
defaultText = lib.literalExpression ''
{
type = "shellcommand";
command = "''\'''${pkgs.notmuch}/bin/notmuch address --format=json --output=recipients date:6M..'";
regexp =
"'\\[?{" + '''"name": "(?P<name>.*)", "address": "(?P<email>.+)", "name-addr": ".*"''' + "}[,\\]]?'";
shellcommand_external_filtering = "False";
}
'';
example = lib.literalExpression '' example = lib.literalExpression ''
{ {
type = "shellcommand"; type = "shellcommand";

View file

@ -41,7 +41,7 @@ in
example = lib.literalExpression '' example = lib.literalExpression ''
{ {
"default" = { "default" = {
"credential_process" = "${pkgs.pass}/bin/pass show aws"; "credential_process" = "''${pkgs.pass}/bin/pass show aws";
}; };
}; };
''; '';

View file

@ -122,6 +122,7 @@ in
browser = mkOption { browser = mkOption {
type = types.str; type = types.str;
default = "${pkgs.xdg-utils}/bin/xdg-open"; default = "${pkgs.xdg-utils}/bin/xdg-open";
defaultText = lib.literalExpression "\${pkgs.xdg-utils}/bin/xdg-open";
description = "External browser to use."; description = "External browser to use.";
}; };

View file

@ -137,7 +137,7 @@ in
description = '' description = ''
A command to run for the matching file. A command to run for the matching file.
''; '';
example = literalExpression ''"${pkgs.vim}/bin/vim -- \"$@\""''; example = literalExpression ''"''${pkgs.vim}/bin/vim -- \"$@\""'';
}; };
}; };
} }

View file

@ -26,7 +26,7 @@ in
default = { }; default = { };
example = lib.literalExpression '' example = lib.literalExpression ''
menu = { menu = {
executable = "${pkgs.wofi}/bin/wofi"; executable = "''${pkgs.wofi}/bin/wofi";
args = [ args = [
"--show=dmenu" "--show=dmenu"
"--allow-markup" "--allow-markup"

View file

@ -124,7 +124,7 @@ in
browser = mkOption { browser = mkOption {
default = null; default = null;
type = types.nullOr types.str; type = types.nullOr types.str;
example = "${pkgs.xdg-utils}/xdg-open"; example = "\${pkgs.xdg-utils}/xdg-open";
description = '' description = ''
Set the default browser for opening links. If its not set, $BROWSER is read. Set the default browser for opening links. If its not set, $BROWSER is read.
If that's not set, url hints will be disabled. If that's not set, url hints will be disabled.

View file

@ -302,7 +302,7 @@ in
shell = mkOption { shell = mkOption {
default = defaultShell; default = defaultShell;
example = literalExpression "${pkgs.zsh}/bin/zsh"; example = literalExpression "\${pkgs.zsh}/bin/zsh";
type = with types; nullOr str; type = with types; nullOr str;
description = "Set the default-shell tmux variable."; description = "Set the default-shell tmux variable.";
}; };

View file

@ -20,6 +20,9 @@ in
soundFont = mkOption { soundFont = mkOption {
type = types.path; type = types.path;
default = "${pkgs.soundfont-fluid}/share/soundfonts/FluidR3_GM2-2.sf2"; default = "${pkgs.soundfont-fluid}/share/soundfonts/FluidR3_GM2-2.sf2";
defaultText = lib.literalExpression ''
"''${pkgs.soundfont-fluid}/share/soundfonts/FluidR3_GM2-2.sf2";
'';
description = '' description = ''
The soundfont file to use, in SoundFont 2 format. The soundfont file to use, in SoundFont 2 format.
''; '';

View file

@ -43,8 +43,8 @@ in
primary = true; primary = true;
atomic = true; atomic = true;
execute_after = [ execute_after = [
"${pkgs.xorg.xrandr}/bin/xrandr --dpi 96" "''${pkgs.xorg.xrandr}/bin/xrandr --dpi 96"
"${pkgs.xmonad-with-packages}/bin/xmonad --restart"; "''${pkgs.xmonad-with-packages}/bin/xmonad --restart";
]; ];
} }
{ {
@ -54,8 +54,8 @@ in
primary = true; primary = true;
atomic = true; atomic = true;
execute_after = [ execute_after = [
"${pkgs.xorg.xrandr}/bin/xrandr --dpi 120" "''${pkgs.xorg.xrandr}/bin/xrandr --dpi 120"
"${pkgs.xmonad-with-packages}/bin/xmonad --restart"; "''${pkgs.xmonad-with-packages}/bin/xmonad --restart";
]; ];
} }
] ]

View file

@ -76,8 +76,8 @@ in
default = [ ]; default = [ ];
example = literalExpression '' example = literalExpression ''
[ [
{ timeout = 60; command = "${pkgs.swaylock}/bin/swaylock -fF"; } { timeout = 60; command = "''${pkgs.swaylock}/bin/swaylock -fF"; }
{ timeout = 90; command = "${pkgs.systemd}/bin/systemctl suspend"; } { timeout = 90; command = "''${pkgs.systemd}/bin/systemctl suspend"; }
] ]
''; '';
description = "List of commands to run after idle timeout."; description = "List of commands to run after idle timeout.";
@ -88,7 +88,7 @@ in
default = [ ]; default = [ ];
example = literalExpression '' example = literalExpression ''
[ [
{ event = "before-sleep"; command = "${pkgs.swaylock}/bin/swaylock -fF"; } { event = "before-sleep"; command = "''${pkgs.swaylock}/bin/swaylock -fF"; }
{ event = "lock"; command = "lock"; } { event = "lock"; command = "lock"; }
] ]
''; '';

View file

@ -54,7 +54,7 @@ in
extraConfig = mkOption { extraConfig = mkOption {
type = types.attrs; type = types.attrs;
default = { }; default = { };
example = literalExpression ''{ main.activation_command = "\${pkgs.hello}/bin/hello"; }''; example = literalExpression ''{ main.activation_command = "''${pkgs.hello}/bin/hello"; }'';
description = '' description = ''
Extra configuration options to add to the twmnd config file. See Extra configuration options to add to the twmnd config file. See
<https://github.com/sboli/twmn/blob/master/README.md> <https://github.com/sboli/twmn/blob/master/README.md>

View file

@ -42,6 +42,16 @@ let
batch = "true"; batch = "true";
log = "false"; # don't log to file, handled by systemd log = "false"; # don't log to file, handled by systemd
}; };
defaultText = lib.literalExpression ''
{
repeat = "watch";
sshcmd = "''${pkgs.openssh}/bin/ssh";
ui = "text";
auto = "true";
batch = "true";
log = "false"; # don't log to file, handled by systemd
}
'';
description = '' description = ''
Additional command line options as a dictionary to pass to the Additional command line options as a dictionary to pass to the
`unison` program. `unison` program.

View file

@ -98,7 +98,6 @@ let
defaultText = literalExpression '' defaultText = literalExpression ''
null for state version 20.09, as example otherwise null for state version 20.09, as example otherwise
''; '';
example = default;
} }
); );
in in
@ -181,7 +180,7 @@ let
pkg = if isSway && isNull cfg.package then pkgs.sway else cfg.package; pkg = if isSway && isNull cfg.package then pkgs.sway else cfg.package;
in in
"${pkg}/bin/${moduleName}bar"; "${pkg}/bin/${moduleName}bar";
defaultText = "i3bar"; defaultText = literalExpression "i3bar";
description = "Command that will be used to start a bar."; description = "Command that will be used to start a bar.";
example = if isI3 then "\${pkgs.i3}/bin/i3bar -t" else "\${pkgs.waybar}/bin/waybar"; example = if isI3 then "\${pkgs.i3}/bin/i3bar -t" else "\${pkgs.waybar}/bin/waybar";
}; };
@ -189,6 +188,7 @@ let
statusCommand = mkNullableOption { statusCommand = mkNullableOption {
type = types.str; type = types.str;
default = "${pkgs.i3status}/bin/i3status"; default = "${pkgs.i3status}/bin/i3status";
defaultText = literalExpression "\${pkgs.i3status}/bin/i3status";
description = "Command that will be used to get status lines."; description = "Command that will be used to get status lines.";
}; };
@ -959,6 +959,9 @@ in
terminal = mkOption { terminal = mkOption {
type = types.str; type = types.str;
default = if isI3 then "i3-sensible-terminal" else "${pkgs.foot}/bin/foot"; default = if isI3 then "i3-sensible-terminal" else "${pkgs.foot}/bin/foot";
defaultText = literalExpression (
if isI3 then ''"i3-sensible-terminal"'' else "\${pkgs.foot}/bin/foot"
);
description = "Default terminal to run."; description = "Default terminal to run.";
example = "alacritty"; example = "alacritty";
}; };
@ -970,6 +973,12 @@ in
"${pkgs.dmenu}/bin/dmenu_path | ${pkgs.dmenu}/bin/dmenu | ${pkgs.findutils}/bin/xargs swaymsg exec --" "${pkgs.dmenu}/bin/dmenu_path | ${pkgs.dmenu}/bin/dmenu | ${pkgs.findutils}/bin/xargs swaymsg exec --"
else else
"${pkgs.dmenu}/bin/dmenu_run"; "${pkgs.dmenu}/bin/dmenu_run";
defaultText = literalExpression (
if isSway then
"\${pkgs.dmenu}/bin/dmenu_path | \${pkgs.dmenu}/bin/dmenu | \${pkgs.findutils}/bin/xargs swaymsg exec --"
else
"\${pkgs.dmenu}/bin/dmenu_run"
);
description = "Default launcher to use."; description = "Default launcher to use.";
example = "bemenu-run"; example = "bemenu-run";
}; };

View file

@ -155,9 +155,9 @@ let
let let
modifier = config.wayland.windowManager.sway.config.modifier; modifier = config.wayland.windowManager.sway.config.modifier;
in lib.mkOptionDefault { in lib.mkOptionDefault {
"''${modifier}+Return" = "exec ${cfg.config.terminal}"; "''${modifier}+Return" = "exec ''${cfg.config.terminal}";
"''${modifier}+Shift+q" = "kill"; "''${modifier}+Shift+q" = "kill";
"''${modifier}+d" = "exec ${cfg.config.menu}"; "''${modifier}+d" = "exec ''${cfg.config.menu}";
} }
''; '';
}; };
@ -509,7 +509,7 @@ in
withBaseWrapper = cfg.wrapperFeatures.base; withBaseWrapper = cfg.wrapperFeatures.base;
withGtkWrapper = cfg.wrapperFeatures.gtk; withGtkWrapper = cfg.wrapperFeatures.gtk;
}; };
defaultText = lib.literalExpression "${pkgs.sway}"; defaultText = lib.literalExpression "\${pkgs.sway}";
description = '' description = ''
Sway package to use. Will override the options Sway package to use. Will override the options
'wrapperFeatures', 'extraSessionCommands', and 'extraOptions'. 'wrapperFeatures', 'extraSessionCommands', and 'extraOptions'.