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

treewide: add missing package options (#7575)

Add options to support more flexible module configurations.

Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
This commit is contained in:
Austin Horstman 2025-07-29 12:20:22 -05:00 committed by GitHub
parent 25deca8939
commit 03fdb31290
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
34 changed files with 147 additions and 70 deletions

View file

@ -20,6 +20,8 @@ in
programs.browserpass = {
enable = lib.mkEnableOption "the browserpass extension host application";
package = lib.mkPackageOption pkgs "browserpass" { };
browsers = lib.mkOption {
type = lib.types.listOf (lib.types.enum browsers);
default = browsers;
@ -47,7 +49,7 @@ in
# Policies are read from `/etc/brave/policies` only
# https://github.com/brave/brave-browser/issues/19052
"${dir}/com.github.browserpass.native.json".source =
"${pkgs.browserpass}/lib/browserpass/hosts/chromium/com.github.browserpass.native.json";
"${cfg.package}/lib/browserpass/hosts/chromium/com.github.browserpass.native.json";
}
]
else if x == "chrome" then
@ -61,9 +63,9 @@ in
[
{
"${dir}/com.github.browserpass.native.json".source =
"${pkgs.browserpass}/lib/browserpass/hosts/chromium/com.github.browserpass.native.json";
"${cfg.package}/lib/browserpass/hosts/chromium/com.github.browserpass.native.json";
"${dir}/../policies/managed/com.github.browserpass.native.json".source =
"${pkgs.browserpass}/lib/browserpass/policies/chromium/com.github.browserpass.native.json";
"${cfg.package}/lib/browserpass/policies/chromium/com.github.browserpass.native.json";
}
]
else if x == "chromium" then
@ -77,11 +79,11 @@ in
[
{
"${dir}/com.github.browserpass.native.json".source =
"${pkgs.browserpass}/lib/browserpass/hosts/chromium/com.github.browserpass.native.json";
"${cfg.package}/lib/browserpass/hosts/chromium/com.github.browserpass.native.json";
}
{
"${dir}/../policies/managed/com.github.browserpass.native.json".source =
"${pkgs.browserpass}/lib/browserpass/policies/chromium/com.github.browserpass.native.json";
"${cfg.package}/lib/browserpass/policies/chromium/com.github.browserpass.native.json";
}
]
else if x == "firefox" then
@ -95,7 +97,7 @@ in
[
{
"${dir}/com.github.browserpass.native.json".source =
"${pkgs.browserpass}/lib/browserpass/hosts/firefox/com.github.browserpass.native.json";
"${cfg.package}/lib/browserpass/hosts/firefox/com.github.browserpass.native.json";
}
]
else if x == "librewolf" then
@ -109,7 +111,7 @@ in
[
{
"${dir}/com.github.browserpass.native.json".source =
"${pkgs.browserpass}/lib/browserpass/hosts/firefox/com.github.browserpass.native.json";
"${cfg.package}/lib/browserpass/hosts/firefox/com.github.browserpass.native.json";
}
]
@ -124,9 +126,9 @@ in
[
{
"${dir}/com.github.browserpass.native.json".source =
"${pkgs.browserpass}/lib/browserpass/hosts/chromium/com.github.browserpass.native.json";
"${cfg.package}/lib/browserpass/hosts/chromium/com.github.browserpass.native.json";
"${dir}/../policies/managed/com.github.browserpass.native.json".source =
"${pkgs.browserpass}/lib/browserpass/policies/chromium/com.github.browserpass.native.json";
"${cfg.package}/lib/browserpass/policies/chromium/com.github.browserpass.native.json";
}
]
else

View file

@ -26,12 +26,6 @@
let
cfg = config.programs.info;
# Installs this package -- the interactive just means that it
# includes the curses `info` program. We also use `install-info`
# from this package in the activation script.
infoPkg = pkgs.texinfoInteractive;
in
{
imports = [
@ -41,11 +35,18 @@ in
'')
];
options.programs.info.enable = lib.mkEnableOption "GNU Info";
options.programs.info = {
enable = lib.mkEnableOption "GNU Info";
# Installs this package -- the interactive just means that it
# includes the curses `info` program. We also use `install-info`
# from this package in the activation script.
package = lib.mkPackageOption pkgs "texinfo" { default = "texinfoInteractive"; };
};
config = lib.mkIf cfg.enable {
home.packages = [
infoPkg
cfg.package
# Make sure the target directory is a real directory.
(pkgs.runCommandLocal "dummy-info-dir1" { } "mkdir -p $out/share/info")
@ -63,7 +64,7 @@ in
PATH="${
lib.makeBinPath [
pkgs.gzip
infoPkg
cfg.package
]
}''${PATH:+:}$PATH" \
find -L "${infoPath}" \( -name '*.info' -o -name '*.info.gz' \) \

View file

@ -186,6 +186,8 @@ in
programs.irssi = {
enable = lib.mkEnableOption "the Irssi chat client";
package = lib.mkPackageOption pkgs "irssi" { nullable = true; };
extraConfig = mkOption {
default = "";
description = "These lines are appended to the Irssi configuration.";
@ -226,7 +228,7 @@ in
};
config = lib.mkIf cfg.enable {
home.packages = [ pkgs.irssi ];
home.packages = lib.mkIf (cfg.package != null) [ cfg.package ];
home.file.".irssi/config".text = ''
settings = {

View file

@ -60,6 +60,8 @@ in
programs.powerline-go = {
enable = lib.mkEnableOption "Powerline-go, a beautiful and useful low-latency prompt for your shell";
package = lib.mkPackageOption pkgs "powerline-go" { };
modules = mkOption {
default = null;
type = types.nullOr (types.listOf types.str);
@ -157,7 +159,7 @@ in
local old_exit_status=$?
${
if evalMode then "eval " else "PS1="
}"$(${pkgs.powerline-go}/bin/powerline-go -error $old_exit_status -shell bash${commandLineArguments})"
}"$(${lib.getExe cfg.package} -error $old_exit_status -shell bash${commandLineArguments})"
${cfg.extraUpdatePS1}
return $old_exit_status
}
@ -171,7 +173,7 @@ in
function powerline_precmd() {
${
if evalMode then "eval " else "PS1="
}"$(${pkgs.powerline-go}/bin/powerline-go -error $? -shell zsh${commandLineArguments})"
}"$(${lib.getExe cfg.package} -error $? -shell zsh${commandLineArguments})"
${cfg.extraUpdatePS1}
}
@ -192,7 +194,7 @@ in
# https://github.com/justjanne/powerline-go#fish
programs.fish.interactiveShellInit = mkIf (cfg.enable && config.programs.fish.enable) ''
function fish_prompt
eval ${pkgs.powerline-go}/bin/powerline-go -error $status -jobs (count (jobs -p))${commandLineArguments}
eval ${lib.getExe cfg.package} -error $status -jobs (count (jobs -p))${commandLineArguments}
${cfg.extraUpdatePS1}
end
'';

View file

@ -28,6 +28,8 @@ in
options.programs.zsh.zplug = {
enable = lib.mkEnableOption "zplug - a zsh plugin manager";
package = lib.mkPackageOption pkgs "zplug" { };
plugins = mkOption {
default = [ ];
type = types.listOf pluginModule;
@ -44,12 +46,12 @@ in
};
config = lib.mkIf cfg.enable {
home.packages = [ pkgs.zplug ];
home.packages = [ cfg.package ];
programs.zsh.initContent = lib.mkOrder 550 ''
export ZPLUG_HOME=${cfg.zplugHome}
source ${pkgs.zplug}/share/zplug/init.zsh
source ${cfg.package}/share/zplug/init.zsh
${optionalString (cfg.plugins != [ ]) ''
${lib.concatStrings (