# serializer version: 1
# name: test_help_for_stdlib_function[asyncio]
'''
Function: lib.strings.splitString
Description: Cut a string with a separator and produces a list of strings which
were separated by this separator.
Categories: lib, strings
Source: https://github.com/nixos/nixpkgs/tree/a338f62ea8defe7b0946f9718204c29105524b35/lib/strings.nix#L1705:C3
Aliases: lib.splitString
'''
# ---
# name: test_help_for_stdlib_function_not_found[asyncio]
"Error: Function 'lib.nonexistent.xyz123' not found on Noogle"
# ---
# name: test_invalid_project[asyncio]
"Error: Invalid project 'invalid-project'. Available: nixos, homemanager, nixvim, nix-darwin, impermanence, microvm, simple-nixos-mailserver, sops-nix, nixos-hardware, disko, nix-nomad"
# ---
# name: test_list_tools[asyncio]
list([
'find_nixpkgs_commit_with_package_version',
'help_for_stdlib_function',
'list_versions',
'read_derivation',
'read_option_declaration',
'search_nix_stdlib',
'search_nixpkgs',
'search_options',
'show_option_details',
])
# ---
# name: test_list_versions_homemanager[asyncio]
'''
homemanager versions:
• unstable
• 25.11 (stable) (default)
• 25.05
• 24.11
• 24.05
• 23.11
• 23.05
• 22.11
'''
# ---
# name: test_list_versions_latest_only[asyncio]
'''
nixvim versions:
• latest (default)
'''
# ---
# name: test_list_versions_nixos[asyncio]
'''
nixos versions:
• 25.11 (nixos-25.11) (default)
• unstable (nixos-unstable)
'''
# ---
# name: test_nixhub_get_commit[asyncio]
'''
Package: nodejs
Version: 20.11.0
Attribute: nodejs_20
Commit: 10b813040df67c4039086db0f6eaf65c536886c6
'''
# ---
# name: test_nixhub_package_not_found[asyncio]
'Error: Request failed (500): https://www.nixhub.io/packages/nonexistent-package-xyz123?_data=routes/_nixhub.packages.$pkg._index'
# ---
# name: test_nixhub_version_not_found_shows_available[asyncio]
"Error: Version '999.999.999' not found for 'nodejs'. Available: 25.2.1, 24.12.0, 24.11.1, 24.11.0, 24.10.0, ... (258 total)"
# ---
# name: test_read_derivation[asyncio]
'''
Reference: https://github.com/NixOS/nixpkgs/blob/nixos-25.11/pkgs/applications/version-management/git/default.nix
Source: 572 lines
{
fetchurl,
lib,
stdenv,
buildPackages,
curl,
openssl,
zlib-ng,
expat,
perlPackages,
python3,
gettext,
gnugrep,
gnused,
gawk,
coreutils, # needed at runtime by git-filter-branch etc
openssh,
pcre2,
bash,
asciidoc,
texinfo,
xmlto,
docbook2x,
docbook_xsl,
docbook_xml_dtd_45,
libxslt,
tcl,
tk,
makeWrapper,
libiconv,
libiconvReal,
svnSupport ? false,
subversionClient,
perlLibs,
smtpPerlLibs,
perlSupport ? stdenv.buildPlatform == stdenv.hostPlatform,
nlsSupport ? true,
osxkeychainSupport ? stdenv.hostPlatform.isDarwin,
guiSupport ? false,
# Disable the manual since libxslt doesn't seem to parse the files correctly.
withManual ? !stdenv.hostPlatform.useLLVM,
pythonSupport ? true,
withpcre2 ? true,
sendEmailSupport ? perlSupport,
nixosTests,
withLibsecret ? false,
pkg-config,
glib,
libsecret,
gzip, # needed at runtime by gitweb.cgi
withSsh ? false,
sysctl,
deterministic-host-uname, # trick Makefile into targeting the host platform when cross-compiling
doInstallCheck ? !stdenv.hostPlatform.isDarwin, # extremely slow on darwin
tests,
}:
assert osxkeychainSupport -> stdenv.hostPlatform.isDarwin;
assert sendEmailSupport -> perlSupport;
assert svnSupport -> perlSupport;
let
version = "2.51.2";
svn = subversionClient.override { perlBindings = perlSupport; };
gitwebPerlLibs = with perlPackages; [
CGI
HTMLParser
CGIFast
FCGI
FCGIProcManager
HTMLTagCloud
];
in
stdenv.mkDerivation (finalAttrs: {
pname =
"git"
+ lib.optionalString svnSupport "-with-svn"
+ lib.optionalString (
!svnSupport && !guiSupport && !sendEmailSupport && !withManual && !pythonSupport && !withpcre2
) "-minimal";
inherit version;
src = fetchurl {
url =
if lib.strings.hasInfix "-rc" version then
"https://www.kernel.org/pub/software/scm/git/testing/git-${
builtins.replaceStrings [ "-" ] [ "." ] version
}.tar.xz"
else
"https://www.kernel.org/pub/software/scm/git/git-${version}.tar.xz";
hash = "sha256-Iz1xQ6LVjmB1Xu6bdvVZ7HPqKzwpf1tQMWKs6VlmtOM=";
};
outputs = [ "out" ] ++ lib.optional withManual "doc";
separateDebugInfo = true;
__structuredAttrs = true;
enableParallelBuilding = true;
enableParallelInstalling = true;
patches = [
# This patch does two things: (1) use the right name for `docbook2texi',
# and (2) make sure `gitman.info' isn't produced since it's broken
# (duplicate node names).
./docbook2texi.patch
# Fix references to gettext.sh at runtime: hard-code it to
# ${pkgs.gettext}/bin/gettext.sh instead of assuming gettext.sh is in $PATH
./git-sh-i18n.patch
# Do not search for sendmail in /usr, only in $PATH
./git-send-email-honor-PATH.patch
]
++ lib.optionals withSsh [
# Hard-code the ssh executable to ${pkgs.openssh}/bin/ssh instead of
# searching in $PATH
./ssh-path.patch
];
postPatch = ''
# Fix references to gettext introduced by ./git-sh-i18n.patch
substituteInPlace git-sh-i18n.sh \
--subst-var-by gettext ${gettext}
substituteInPlace contrib/credential/libsecret/Makefile \
--replace-fail 'pkg-config' "$PKG_CONFIG"
''
+ lib.optionalString doInstallCheck ''
# ensure we are using the correct shell when executing the test scripts
patchShebangs t/*.sh
''
+ lib.optionalString withSsh ''
for x in connect.c git-gui/lib/remote_add.tcl ; do
substituteInPlace "$x" \
--subst-var-by ssh "${openssh}/bin/ssh"
done
'';
nativeBuildInputs = [
deterministic-host-uname
gettext
perlPackages.perl
makeWrapper
pkg-config
]
++ lib.optionals withManual [
asciidoc
texinfo
xmlto
docbook2x
docbook_xsl
docbook_xml_dtd_45
libxslt
];
buildInputs = [
curl
openssl
zlib-ng
expat
(if stdenv.hostPlatform.isFreeBSD then libiconvReal else libiconv)
bash
]
++ lib.optionals perlSupport [ perlPackages.perl ]
++ lib.optionals guiSupport [
tcl
tk
]
++ lib.optionals withpcre2 [ pcre2 ]
++ lib.optionals withLibsecret [
glib
libsecret
];
# required to support pthread_cancel()
env.NIX_LDFLAGS =
lib.optionalString (stdenv.cc.isGNU && stdenv.hostPlatform.libc == "glibc") "-lgcc_s"
+ lib.optionalString (stdenv.hostPlatform.isFreeBSD) "-lthr";
configureFlags = [
"ac_cv_prog_CURL_CONFIG=${lib.getDev curl}/bin/curl-config"
]
++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [
"ac_cv_fread_reads_directories=yes"
"ac_cv_snprintf_returns_bogus=no"
"ac_cv_iconv_omits_bom=no"
];
preBuild = ''
makeFlagsArray+=( perllibdir=$out/$(perl -MConfig -wle 'print substr $Config{installsitelib}, 1 + length $Config{siteprefixexp}') )
'';
makeFlags = [
"prefix=\${out}"
"ZLIB_NG=1"
]
# Git does not allow setting a shell separately for building and run-time.
# Therefore lets leave it at the default /bin/sh when cross-compiling
++ lib.optional (stdenv.buildPlatform == stdenv.hostPlatform) "SHELL_PATH=${stdenv.shell}"
++ (if perlSupport then [ "PERL_PATH=${perlPackages.perl}/bin/perl" ] else [ "NO_PERL=1" ])
++ (if pythonSupport then [ "PYTHON_PATH=${python3}/bin/python" ] else [ "NO_PYTHON=1" ])
++ lib.optionals stdenv.hostPlatform.isSunOS [
"INSTALL=install"
"NO_INET_NTOP="
"NO_INET_PTON="
]
++ (if stdenv.hostPlatform.isDarwin then [ "NO_APPLE_COMMON_CRYPTO=1" ] else [ "sysconfdir=/etc" ])
++ lib.optionals stdenv.hostPlatform.isMusl [
"NO_SYS_POLL_H=1"
"NO_GETTEXT=YesPlease"
]
++ lib.optional withpcre2 "USE_LIBPCRE2=1"
++ lib.optional (!nlsSupport) "NO_GETTEXT=1"
# git-gui refuses to start with the version of tk distributed with
# macOS Catalina. We can prevent git from building the .app bundle
# by specifying an invalid tk framework. The postInstall step will
# then ensure that git-gui uses tcl/tk from nixpkgs, which is an
# acceptable version.
#
# See https://github.com/Homebrew/homebrew-core/commit/dfa3ccf1e7d3901e371b5140b935839ba9d8b706
++ lib.optional stdenv.hostPlatform.isDarwin "TKFRAMEWORK=/nonexistent";
disallowedReferences = lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [
stdenv.shellPackage
];
postBuild = ''
# Set up the flags array for make in the same way as for the main build
# phase from stdenv.
local flagsArray=(
''${enableParallelBuilding:+-j''${NIX_BUILD_CORES}}
SHELL="$SHELL"
)
concatTo flagsArray makeFlags makeFlagsArray buildFlags buildFlagsArray
echoCmd 'build flags' "''${flagsArray[@]}"
''
+ lib.optionalString withManual ''
# Need to build the main Git documentation before building the
# contrib/subtree documentation, as the latter depends on the
# asciidoc.conf file created by the former.
make -C Documentation PERL_PATH=${lib.getExe buildPackages.perlPackages.perl} "''${flagsArray[@]}"
''
+ ''
make -C contrib/subtree "''${flagsArray[@]}" all ${lib.optionalString withManual "doc"}
''
+ lib.optionalString perlSupport ''
make -C contrib/diff-highlight "''${flagsArray[@]}"
''
+ lib.optionalString osxkeychainSupport ''
make -C contrib/credential/osxkeychain "''${flagsArray[@]}"
''
+ lib.optionalString withLibsecret ''
make -C contrib/credential/libsecret "''${flagsArray[@]}"
''
+ ''
unset flagsArray
'';
## Install
# WARNING: Do not `rm` or `mv` files from the source tree; use `cp` instead.
# We need many of these files during the installCheckPhase.
installFlags = [ "NO_INSTALL_HARDLINKS=1" ];
preInstall =
lib.optionalString osxkeychainSupport ''
mkdir -p $out/libexec/git-core
ln -s $out/share/git/contrib/credential/osxkeychain/git-credential-osxkeychain $out/libexec/git-core/
# ideally unneeded, but added for backwards compatibility
mkdir -p $out/bin
ln -s $out/libexec/git-core/git-credential-osxkeychain $out/bin/
rm -f $PWD/contrib/credential/osxkeychain/git-credential-osxkeychain.o
''
+ lib.optionalString withLibsecret ''
mkdir -p $out/libexec/git-core
ln -s $out/share/git/contrib/credential/libsecret/git-credential-libsecret $out/libexec/git-core/
# ideally unneeded, but added for backwards compatibility
mkdir -p $out/bin
ln -s $out/libexec/git-core/git-credential-libsecret $out/bin/
rm -f $PWD/contrib/credential/libsecret/git-credential-libsecret.o
'';
postInstall = ''
# Set up the flags array for make in the same way as for the main install
# phase from stdenv.
local flagsArray=(
''${enableParallelInstalling:+-j''${NIX_BUILD_CORES}}
SHELL="$SHELL"
)
concatTo flagsArray makeFlags makeFlagsArray installFlags installFlagsArray
echoCmd 'install flags' "''${flagsArray[@]}"
# Install git-subtree.
make -C contrib/subtree "''${flagsArray[@]}" install ${lib.optionalString withManual "install-doc"}
rm -rf contrib/subtree
# Install contrib stuff.
mkdir -p $out/share/git
cp -a contrib $out/share/git/
mkdir -p $out/share/bash-completion/completions
ln -s $out/share/git/contrib/completion/git-prompt.sh $out/share/bash-completion/completions/
# grep is a runtime dependency, need to patch so that it's found
substituteInPlace $out/libexec/git-core/git-sh-setup \
--replace ' grep' ' ${gnugrep}/bin/grep' \
--replace ' egrep' ' ${gnugrep}/bin/egrep'
# Fix references to the perl, sed, awk and various coreutil binaries used by
# shell scripts that git calls (e.g. filter-branch)
SCRIPT="$(cat <<'EOS'
BEGIN{
@a=(
'${gnugrep}/bin/grep', '${gnused}/bin/sed', '${gawk}/bin/awk',
'${coreutils}/bin/cut', '${coreutils}/bin/basename', '${coreutils}/bin/dirname',
'${coreutils}/bin/wc', '${coreutils}/bin/tr'
${lib.optionalString perlSupport ", '${perlPackages.perl}/bin/perl'"}
);
}
foreach $c (@a) {
$n=(split("/", $c))[-1];
s|(?<=[^#][^/.-])\b''${n}(?=\s)|''${c}|g
}
EOS
)"
perl -0777 -i -pe "$SCRIPT" \
$out/libexec/git-core/git-{sh-setup,filter-branch,merge-octopus,mergetool,quiltimport,request-pull,submodule,subtree,web--browse}
# Also put git-http-backend into $PATH, so that we can use smart
# HTTP(s) transports for pushing
ln -s $out/libexec/git-core/git-http-backend $out/bin/git-http-backend
ln -s $out/share/git/contrib/git-jump/git-jump $out/bin/git-jump
''
+ lib.optionalString perlSupport ''
# wrap perl commands
makeWrapper "$out/share/git/contrib/credential/netrc/git-credential-netrc.perl" $out/libexec/git-core/git-credential-netrc \
--set PERL5LIB "$out/${perlPackages.perl.libPrefix}:${perlPackages.makePerlPath perlLibs}"
# ideally unneeded, but added for backwards compatibility
ln -s $out/libexec/git-core/git-credential-netrc $out/bin/
wrapProgram $out/libexec/git-core/git-cvsimport \
--set GITPERLLIB "$out/${perlPackages.perl.libPrefix}:${perlPackages.makePerlPath perlLibs}"
wrapProgram $out/libexec/git-core/git-archimport \
--set GITPERLLIB "$out/${perlPackages.perl.libPrefix}:${perlPackages.makePerlPath perlLibs}"
wrapProgram $out/libexec/git-core/git-instaweb \
--set GITPERLLIB "$out/${perlPackages.perl.libPrefix}:${perlPackages.makePerlPath perlLibs}"
wrapProgram $out/libexec/git-core/git-cvsexportcommit \
--set GITPERLLIB "$out/${perlPackages.perl.libPrefix}:${perlPackages.makePerlPath perlLibs}"
# gzip (and optionally bzip2, xz, zip) are runtime dependencies for
# gitweb.cgi, need to patch so that it's found
sed -i -e "s|'compressor' => \['gzip'|'compressor' => ['${gzip}/bin/gzip'|" \
$out/share/gitweb/gitweb.cgi
# Give access to CGI.pm and friends (was removed from perl core in 5.22)
for p in ${lib.concatStringsSep " " gitwebPerlLibs}; do
sed -i -e "/use CGI /i use lib \"$p/${perlPackages.perl.libPrefix}\";" \
"$out/share/gitweb/gitweb.cgi"
done
''
+ (
if svnSupport then
''
# wrap git-svn
wrapProgram $out/libexec/git-core/git-svn \
--set GITPERLLIB "$out/${perlPackages.perl.libPrefix}:${
perlPackages.makePerlPath (perlLibs ++ [ svn.out ])
}" \
--prefix PATH : "${svn.out}/bin"
''
else
''
rm $out/libexec/git-core/git-svn
''
)
+ (
if sendEmailSupport then
''
# wrap git-send-email
wrapProgram $out/libexec/git-core/git-send-email \
--set GITPERLLIB "$out/${perlPackages.perl.libPrefix}:${perlPackages.makePerlPath smtpPerlLibs}"
''
else
''
rm $out/libexec/git-core/git-send-email
''
)
+ lib.optionalString withManual ''
# Install man pages
make "''${flagsArray[@]}" install install-html \
-C Documentation
''
+ (
if guiSupport then
''
# Wrap Tcl/Tk programs
for prog in bin/gitk libexec/git-core/{git-gui,git-citool,git-gui--askpass}; do
sed -i -e "s|exec 'wish'|exec '${tk}/bin/wish'|g" \
-e "s|exec wish|exec '${tk}/bin/wish'|g" \
"$out/$prog"
done
ln -s $out/share/git/contrib/completion/git-completion.bash $out/share/bash-completion/completions/gitk
''
else
''
for prog in bin/gitk libexec/git-core/git-gui; do
rm "$out/$prog"
done
''
)
+ lib.optionalString osxkeychainSupport ''
# enable git-credential-osxkeychain on darwin if desired (default)
mkdir -p $out/etc
cat > $out/etc/gitconfig << EOF
[credential]
helper = osxkeychain
EOF
''
+ ''
unset flagsArray
'';
## InstallCheck
doCheck = false;
inherit doInstallCheck;
installCheckTarget = "test";
# see also installCheckFlagsArray
installCheckFlags = [
"DEFAULT_TEST_TARGET=prove"
"PERL_PATH=${buildPackages.perl}/bin/perl"
];
nativeInstallCheckInputs = lib.optional (
stdenv.hostPlatform.isDarwin || stdenv.hostPlatform.isFreeBSD
) sysctl;
preInstallCheck = ''
# Some tests break with high concurrency
# https://github.com/NixOS/nixpkgs/pull/403237
if ((NIX_BUILD_CORES > 32)); then
NIX_BUILD_CORES=32
fi
installCheckFlagsArray+=(
GIT_PROVE_OPTS="--jobs $NIX_BUILD_CORES --failures --state=failed,save"
GIT_TEST_INSTALLED=$out/bin
${lib.optionalString (!svnSupport) "NO_SVN_TESTS=y"}
)
function disable_test {
local test=$1 pattern=$2
if [ $# -eq 1 ]; then
mv t/{,skip-}$test.sh || true
else
sed -i t/$test.sh \
-e "/^\s*test_expect_.*$pattern/,/^\s*' *\$/{s/^/: #/}"
fi
}
# Shared permissions are forbidden in sandbox builds:
substituteInPlace t/test-lib.sh \
--replace "test_set_prereq POSIXPERM" ""
# TODO: Investigate while these still fail (without POSIXPERM):
# Tested to fail: 2.46.0
disable_test t0001-init 'shared overrides system'
# Tested to fail: 2.46.0
disable_test t0001-init 'init honors global core.sharedRepository'
# Tested to fail: 2.46.0
disable_test t1301-shared-repo
# /build/git-2.44.0/contrib/completion/git-completion.bash: line 452: compgen: command not found
disable_test t9902-completion
''
+ lib.optionalString (!sendEmailSupport) ''
# Disable sendmail tests
disable_test t9001-send-email
''
+ ''
# Flaky tests:
disable_test t0027-auto-crlf
disable_test t1451-fsck-buffer
disable_test t5319-multi-pack-index
disable_test t6421-merge-partial-clone
disable_test t7504-commit-msg-hook
disable_test t5515-fetch-merge-logic
disable_test t4104-apply-boundary
disable_test t7002-mv-sparse-checkout
disable_test t4122-apply-symlink-inside
disable_test t7513-interpret-trailers
disable_test t2200-add-update
# Fails reproducibly on ZFS on Linux with formD normalization
disable_test t0021-conversion
disable_test t3910-mac-os-precompose
''
+ lib.optionalString stdenv.hostPlatform.isDarwin ''
# XXX: Some tests added in 2.24.0 fail.
# Please try to re-enable on the next release.
disable_test t7816-grep-binary-pattern
# fail (as of 2.33.0)
#===( 18623;1208 8/? 224/? 2/? )= =fatal: Not a valid object name refs/tags/signed-empty
disable_test t6300-for-each-ref
# not ok 1 - populate workdir (with 2.33.1 on x86_64-darwin)
disable_test t5003-archive-zip
''
+ lib.optionalString (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) ''
disable_test t7527-builtin-fsmonitor
''
+
lib.optionalString (stdenv.hostPlatform.isStatic && stdenv.hostPlatform.system == "x86_64-linux")
''
# https://github.com/NixOS/nixpkgs/pull/394957
# > t2082-parallel-checkout-attributes.sh (Wstat: 256 (exited 1) Tests: 5 Failed: 1)
disable_test t2082-parallel-checkout-attributes
''
+ lib.optionalString stdenv.hostPlatform.isMusl ''
# Test fails (as of 2.17.0, musl 1.1.19)
disable_test t3900-i18n-commit
# Fails largely due to assumptions about BOM
# Tested to fail: 2.18.0
disable_test t0028-working-tree-encoding
'';
stripDebugList = [
"lib"
"libexec"
"bin"
"share/git/contrib/credential"
];
passthru = {
shellPath = "/bin/git-shell";
tests = {
withInstallCheck = finalAttrs.finalPackage.overrideAttrs (_: {
doInstallCheck = true;
});
buildbot-integration = nixosTests.buildbot;
}
// tests.fetchgit;
updateScript = ./update.sh;
};
meta = {
homepage = "https://git-scm.com/";
description = "Distributed version control system";
license = lib.licenses.gpl2;
changelog = "https://github.com/git/git/blob/v${version}/Documentation/RelNotes/${version}.txt";
longDescription = ''
Git, a popular distributed version control system designed to
handle very large projects with speed and efficiency.
'';
platforms = lib.platforms.all;
maintainers = with lib.maintainers; [
wmertens
globin
kashw2
me-and
philiptaron
];
mainProgram = "git";
};
})
'''
# ---
# name: test_read_option_declaration_homemanager[asyncio]
'''
Note: Version '25.11' not found, using 'unstable' instead.
Reference: https://github.com/nix-community/home-manager/blob/master/modules/programs/git.nix
Source: 605 lines
{
config,
lib,
pkgs,
...
}:
let
inherit (lib)
concatStringsSep
literalExpression
mkDefault
mkEnableOption
mkIf
mkOption
mkOptionDefault
types
;
cfg = config.programs.git;
in
{
meta.maintainers = with lib.maintainers; [
khaneliman
rycee
];
options =
let
gitIniType =
with types;
let
primitiveType = either str (either bool int);
multipleType = either primitiveType (listOf primitiveType);
sectionType = attrsOf multipleType;
supersectionType = attrsOf (either multipleType sectionType);
in
attrsOf supersectionType;
in
{
programs.git = {
enable = mkEnableOption "Git";
package = lib.mkPackageOption pkgs "git" {
nullable = true;
example = "pkgs.gitFull";
extraDescription = ''
Use {var}`pkgs.gitFull`
to gain access to {command}`git send-email` for instance.
'';
};
signing = {
key = mkOption {
type = types.nullOr types.str;
default = null;
description = ''
The default signing key fingerprint.
Set to `null` to let the signer decide what signing key
to use depending on commit’s author.
'';
};
format = mkOption {
type = types.nullOr (
types.enum [
"openpgp"
"ssh"
"x509"
]
);
defaultText = literalExpression ''
"openpgp" for state version < 25.05,
undefined for state version ≥ 25.05
'';
description = ''
The signing method to use when signing commits and tags.
Valid values are `openpgp` (OpenPGP/GnuPG), `ssh` (SSH), and `x509` (X.509 certificates).
'';
};
signByDefault = mkOption {
type = types.nullOr types.bool;
default = null;
description = "Whether commits and tags should be signed by default.";
};
signer = mkOption {
type = types.nullOr types.str;
description = "Path to signer binary to use.";
};
};
settings = mkOption {
type = gitIniType;
default = { };
example = {
core = {
whitespace = "trailing-space,space-before-tab";
};
url."ssh://git@host".insteadOf = "otherhost";
};
description = ''
Configuration written to {file}`$XDG_CONFIG_HOME/git/config`.
See {manpage}`git-config(1)` for details.
'';
};
hooks = mkOption {
type = types.attrsOf types.path;
default = { };
example = literalExpression ''
{
pre-commit = ./pre-commit-script;
}
'';
description = ''
Configuration helper for Git hooks.
See <https://git-scm.com/docs/githooks>
for reference.
'';
};
iniContent = mkOption {
type = gitIniType;
internal = true;
};
ignores = mkOption {
type = types.listOf types.str;
default = [ ];
example = [
"*~"
"*.swp"
];
description = "List of paths that should be globally ignored.";
};
attributes = mkOption {
type = types.listOf types.str;
default = [ ];
example = [ "*.pdf diff=pdf" ];
description = "List of defining attributes set globally.";
};
includes = mkOption {
type = types.listOf (
types.submodule (
{ config, ... }:
{
options = {
condition = mkOption {
type = types.nullOr types.str;
default = null;
description = ''
Include this configuration only when {var}`condition`
matches. Allowed conditions are described in
{manpage}`git-config(1)`.
'';
};
path = mkOption {
type = with types; either str path;
description = "Path of the configuration file to include.";
};
contents = mkOption {
type = types.attrsOf types.anything;
default = { };
example = literalExpression ''
{
user = {
email = "bob@work.example.com";
name = "Bob Work";
signingKey = "1A2B3C4D5E6F7G8H";
};
commit = {
gpgSign = true;
};
};
'';
description = ''
Configuration to include. If empty then a path must be given.
This follows the configuration structure as described in
{manpage}`git-config(1)`.
'';
};
contentSuffix = mkOption {
type = types.str;
default = "gitconfig";
description = ''
Nix store name for the git configuration text file,
when generating the configuration text from nix options.
'';
};
};
config.path = mkIf (config.contents != { }) (
mkDefault (
pkgs.writeText (lib.hm.strings.storeFileName config.contentSuffix) (
lib.generators.toGitINI config.contents
)
)
);
}
)
);
default = [ ];
example = literalExpression ''
[
{ path = "~/path/to/config.inc"; }
{
path = "~/path/to/conditional.inc";
condition = "gitdir:~/src/dir";
}
]
'';
description = "List of configuration files to include.";
};
lfs = {
enable = mkEnableOption "Git Large File Storage";
package = lib.mkPackageOption pkgs "git-lfs" { nullable = true; };
skipSmudge = mkOption {
type = types.bool;
default = false;
description = ''
Skip automatic downloading of objects on clone or pull.
This requires a manual {command}`git lfs pull`
every time a new commit is checked out on your repository.
'';
};
};
maintenance = {
enable = mkEnableOption "" // {
description = ''
Enable the automatic {command}`git maintenance`.
If you have SSH remotes, set {option}`programs.git.package` to a
git version with SSH support (eg: `pkgs.gitFull`).
See <https://git-scm.com/docs/git-maintenance>.
'';
};
repositories = mkOption {
type = with types; listOf str;
default = [ ];
description = ''
Repositories on which {command}`git maintenance` should run.
Should be a list of absolute paths.
'';
};
timers = mkOption {
type = types.attrsOf types.str;
default = {
hourly = "*-*-* 1..23:53:00";
daily = "Tue..Sun *-*-* 0:53:00";
weekly = "Mon 0:53:00";
};
description = ''
Systemd timers to create for scheduled {command}`git maintenance`.
Key is passed to `--schedule` argument in {command}`git maintenance run`
and value is passed to `Timer.OnCalendar` in `systemd.user.timers`.
'';
};
};
};
};
imports =
let
oldPrefix = [
"programs"
"git"
];
newPrefix = [
"programs"
"git"
"settings"
];
in
[
(lib.mkRenamedOptionModule
[ "programs" "git" "signing" "gpgPath" ]
[
"programs"
"git"
"signing"
"signer"
]
)
(lib.mkRenamedOptionModule [ "programs" "git" "extraConfig" ] [ "programs" "git" "settings" ])
]
++ (lib.hm.deprecations.mkSettingsRenamedOptionModules oldPrefix newPrefix
{
transform = x: x;
}
[
{
old = [ "userName" ];
new = [
"user"
"name"
];
}
{
old = [ "userEmail" ];
new = [
"user"
"email"
];
}
{
old = [ "aliases" ];
new = [ "alias" ];
}
]
);
config = mkIf cfg.enable (
lib.mkMerge [
{
home.packages = lib.optionals (cfg.package != null) [ cfg.package ];
assertions = [
{
assertion =
let
enabled = [
(config.programs.delta.enable && config.programs.delta.enableGitIntegration)
(config.programs.diff-highlight.enable && config.programs.diff-highlight.enableGitIntegration)
(config.programs.diff-so-fancy.enable && config.programs.diff-so-fancy.enableGitIntegration)
(config.programs.difftastic.enable && config.programs.difftastic.git.enable)
(config.programs.patdiff.enable && config.programs.patdiff.enableGitIntegration)
(config.programs.riff.enable && config.programs.riff.enableGitIntegration)
];
in
lib.count lib.id enabled <= 1;
message = "Only one of 'programs.git.delta.enable' or 'programs.git.difftastic.enable' or 'programs.git.diff-so-fancy.enable' or 'programs.git.diff-highlight' or 'programs.git.patdiff' can be set to true at the same time.";
}
];
xdg.configFile = {
"git/config".text = lib.generators.toGitINI cfg.iniContent;
"git/ignore" = mkIf (cfg.ignores != [ ]) {
text = concatStringsSep "\n" cfg.ignores + "\n";
};
"git/attributes" = mkIf (cfg.attributes != [ ]) {
text = concatStringsSep "\n" cfg.attributes + "\n";
};
};
}
{
programs.git.iniContent =
let
hasSmtp = _name: account: account.enable && account.smtp != null;
genIdentity =
name: account:
let
inherit (account)
address
realName
smtp
userName
;
in
lib.nameValuePair "sendemail.${name}" (
if account.msmtp.enable then
{
sendmailCmd = "${pkgs.msmtp}/bin/msmtp";
envelopeSender = "auto";
from = "${realName} <${address}>";
}
else
{
smtpEncryption =
if smtp.tls.enable then
(if smtp.tls.useStartTls || lib.versionOlder config.home.stateVersion "20.09" then "tls" else "ssl")
else
"";
smtpSslCertPath = mkIf smtp.tls.enable (toString smtp.tls.certificatesFile);
smtpServer = smtp.host;
smtpUser = userName;
from = "${realName} <${address}>";
}
// lib.optionalAttrs (smtp.port != null) {
smtpServerPort = smtp.port;
}
);
in
lib.mapAttrs' genIdentity (lib.filterAttrs hasSmtp config.accounts.email.accounts);
}
(mkIf (cfg.signing != { }) {
programs.git = {
signing = {
format =
if (lib.versionOlder config.home.stateVersion "25.05") then
(mkOptionDefault "openpgp")
else
(mkOptionDefault null);
signer =
let
defaultSigners = {
openpgp = lib.getExe config.programs.gpg.package;
ssh = lib.getExe' pkgs.openssh "ssh-keygen";
x509 = lib.getExe' config.programs.gpg.package "gpgsm";
};
in
mkIf (cfg.signing.format != null) (mkOptionDefault defaultSigners.${cfg.signing.format});
};
iniContent = lib.mkMerge [
(mkIf (cfg.signing.key != null) {
user.signingKey = mkDefault cfg.signing.key;
})
(mkIf (cfg.signing.signByDefault != null) {
commit.gpgSign = mkDefault cfg.signing.signByDefault;
tag.gpgSign = mkDefault cfg.signing.signByDefault;
})
(mkIf (cfg.signing.format != null) {
gpg = {
format = mkDefault cfg.signing.format;
${cfg.signing.format}.program = mkDefault cfg.signing.signer;
};
})
];
};
})
(mkIf (cfg.hooks != { }) {
programs.git.iniContent = {
core.hooksPath =
let
entries = lib.mapAttrsToList (name: path: { inherit name path; }) cfg.hooks;
in
toString (pkgs.linkFarm "git-hooks" entries);
};
})
(mkIf (cfg.settings != { }) {
programs.git.iniContent = cfg.settings;
})
(mkIf (cfg.includes != [ ]) {
xdg.configFile."git/config".text =
let
include =
i:
with i;
if condition != null then
{
includeIf.${condition}.path = "${path}";
}
else
{
include.path = "${path}";
};
in
lib.mkAfter (concatStringsSep "\n" (map lib.generators.toGitINI (map include cfg.includes)));
})
(mkIf cfg.lfs.enable {
home.packages = lib.mkIf (cfg.lfs.package != null) [ cfg.lfs.package ];
programs.git.iniContent.filter.lfs =
let
skipArg = lib.optional cfg.lfs.skipSmudge "--skip";
in
{
clean = "git-lfs clean -- %f";
process = concatStringsSep " " (
[
"git-lfs"
"filter-process"
]
++ skipArg
);
required = true;
smudge = concatStringsSep " " (
[
"git-lfs"
"smudge"
]
++ skipArg
++ [
"--"
"%f"
]
);
};
})
(mkIf cfg.maintenance.enable {
programs.git.iniContent.maintenance.repo = cfg.maintenance.repositories;
systemd.user.services."git-maintenance@" = {
Unit = {
Description = "Optimize Git repositories data";
Documentation = [ "man:git-maintenance(1)" ];
};
Service = {
Type = "oneshot";
ExecStart =
let
exe = if cfg.package != null then lib.getExe cfg.package else "git";
in
''
"${exe}" for-each-repo --keep-going --config=maintenance.repo maintenance run --schedule=%i
'';
LockPersonality = "yes";
MemoryDenyWriteExecute = "yes";
NoNewPrivileges = "yes";
RestrictAddressFamilies = "AF_UNIX AF_INET AF_INET6 AF_VSOCK";
RestrictNamespaces = "yes";
RestrictRealtime = "yes";
RestrictSUIDSGID = "yes";
SystemCallArchitectures = "native";
SystemCallFilter = "@system-service";
};
};
systemd.user.timers =
let
toSystemdTimer =
name: time:
lib.attrsets.nameValuePair "git-maintenance@${name}" {
Unit.Description = "Optimize Git repositories data";
Timer = {
OnCalendar = time;
Persistent = true;
};
Install.WantedBy = [ "timers.target" ];
};
in
lib.attrsets.mapAttrs' toSystemdTimer cfg.maintenance.timers;
launchd.agents =
let
baseArguments = [
"${if cfg.package != null then lib.getExe cfg.package else "git"}"
"for-each-repo"
"--keep-going"
"--config=maintenance.repo"
"maintenance"
"run"
];
in
{
"git-maintenance-hourly" = {
enable = true;
config = {
ProgramArguments = baseArguments ++ [ "--schedule=hourly" ];
StartCalendarInterval = map (hour: {
Hour = hour;
Minute = 53;
}) (lib.range 1 23);
};
};
"git-maintenance-daily" = {
enable = true;
config = {
ProgramArguments = baseArguments ++ [ "--schedule=daily" ];
StartCalendarInterval = map (weekday: {
Weekday = weekday;
Hour = 0;
Minute = 53;
}) (lib.range 1 6);
};
};
"git-maintenance-weekly" = {
enable = true;
config = {
ProgramArguments = baseArguments ++ [ "--schedule=weekly" ];
StartCalendarInterval = [
{
Weekday = 0;
Hour = 0;
Minute = 53;
}
];
};
};
};
})
]
);
}
'''
# ---
# name: test_read_option_declaration_nix_darwin[asyncio]
'''
Reference: https://github.com/nix-darwin/nix-darwin/blob/c31afa6e76da9bbc7c9295e39c7de9fca1071ea1/modules/system/version.nix
Source: 156 lines
{ options, config, lib, ... }:
with lib;
let
cfg = config.system;
# Based on `lib.trivial.revisionWithDefault` from nixpkgs.
gitRevision = path:
if pathIsGitRepo "${path}/.git"
then commitIdFromGitRepo "${path}/.git"
else if pathExists "${path}/.git-revision"
then fileContents "${path}/.git-revision"
else null;
nixpkgsSrc = config.nixpkgs.source;
# If `nixpkgs.constructedByUs` is true, then Nixpkgs was imported from
# `nixpkgs.source` and we can use revision information (flake input,
# `builtins.fetchGit`, etc.) from it. Otherwise `pkgs` could be
# anything and we can't reliably determine exact version information,
# but if the configuration explicitly sets `nixpkgs.source` we
# trust it.
useSourceRevision =
(config.nixpkgs.constructedByUs
|| options.nixpkgs.source.highestPrio < (lib.mkDefault {}).priority)
&& isAttrs nixpkgsSrc
&& (nixpkgsSrc._type or null == "flake"
|| isString (nixpkgsSrc.rev or null));
in
{
options = {
system.stateVersion = mkOption {
type = types.ints.between 1 config.system.maxStateVersion;
# TODO: Remove this default and the assertion below.
default = config.system.maxStateVersion;
description = ''
Every once in a while, a new nix-darwin release may change
configuration defaults in a way incompatible with stateful
data. For instance, if the default version of PostgreSQL
changes, the new version will probably be unable to read your
existing databases. To prevent such breakage, you can set the
value of this option to the nix-darwin release with which you want
to be compatible. The effect is that nix-darwin will option
defaults corresponding to the specified release (such as using
an older version of PostgreSQL).
'';
};
system.maxStateVersion = mkOption {
internal = true;
type = types.int;
default = 6;
};
system.darwinLabel = mkOption {
type = types.str;
description = "Label to be used in the names of generated outputs.";
};
system.darwinRelease = mkOption {
readOnly = true;
type = types.str;
default = (lib.importJSON ../../version.json).release;
description = "The nix-darwin release (e.g. `24.11`).";
};
system.darwinVersion = mkOption {
internal = true;
type = types.str;
default = cfg.darwinRelease + cfg.darwinVersionSuffix;
description = "The full nix-darwin version (e.g. `24.11.2abdb5a`).";
};
system.darwinVersionSuffix = mkOption {
internal = true;
type = types.str;
default = if cfg.darwinRevision != null
then ".${substring 0 7 cfg.darwinRevision}"
else "";
description = "The short nix-darwin version suffix (e.g. `.2abdb5a`).";
};
system.darwinRevision = mkOption {
internal = true;
type = types.nullOr types.str;
default = gitRevision (toString ../..);
description = "The darwin git revision from which this configuration was built.";
};
system.nixpkgsRelease = mkOption {
readOnly = true;
type = types.str;
default = lib.trivial.release;
description = "The nixpkgs release (e.g. `24.11`).";
};
# TODO: Shouldn’t mismatch the Darwin release, rethink all this…
system.nixpkgsVersion = mkOption {
internal = true;
type = types.str;
default = cfg.nixpkgsRelease + cfg.nixpkgsVersionSuffix;
description = "The full nixpkgs version (e.g. `24.11.1160.f2d4ee1`).";
};
system.nixpkgsVersionSuffix = mkOption {
internal = true;
type = types.str;
default = if useSourceRevision
then ".${lib.substring 0 8 (nixpkgsSrc.lastModifiedDate or nixpkgsSrc.lastModified or "19700101")}.${nixpkgsSrc.shortRev or "dirty"}"
else lib.trivial.versionSuffix;
description = "The short nixpkgs version suffix (e.g. `.1160.f2d4ee1`).";
};
system.nixpkgsRevision = mkOption {
internal = true;
type = types.nullOr types.str;
default = if useSourceRevision && nixpkgsSrc ? rev
then nixpkgsSrc.rev
else lib.trivial.revisionWithDefault null;
description = "The nixpkgs git revision from which this configuration was built.";
};
system.configurationRevision = mkOption {
type = types.nullOr types.str;
default = null;
description = "The Git revision of the top-level flake from which this configuration was built.";
};
};
config = {
# This default is set here rather than up there so that the options
# documentation is not reprocessed on every commit
system.darwinLabel = mkDefault cfg.darwinVersion;
assertions = [
{
assertion = options.system.stateVersion.highestPrio != (lib.mkOptionDefault { }).priority;
message = ''
The `system.stateVersion` option is not defined in your
nix-darwin configuration. The value is used to conditionalize
backwards‐incompatible changes in default settings. You should
usually set this once when installing nix-darwin on a new system
and then never change it (at least without reading all the relevant
entries in the changelog using `darwin-rebuild changelog`).
You can use the current value for new installations as follows:
system.stateVersion = ${toString config.system.maxStateVersion};
'';
}
];
};
}
'''
# ---
# name: test_read_option_declaration_nix_nomad_not_supported[asyncio]
"Error: nix-nomad options don't have readable declarations. They are auto-generated from external specifications (Nomad HCL)."
# ---
# name: test_read_option_declaration_nixos[asyncio]
'''
Reference: https://github.com/NixOS/nixpkgs/blob/nixos-25.11/nixos/modules/config/locale.nix
Source: 103 lines
{
config,
lib,
pkgs,
...
}:
let
tzdir = "${pkgs.tzdata}/share/zoneinfo";
nospace = str: lib.filter (c: c == " ") (lib.stringToCharacters str) == [ ];
timezone = lib.types.nullOr (lib.types.addCheck lib.types.str nospace) // {
description = "null or string without spaces";
};
lcfg = config.location;
in
{
options = {
time = {
timeZone = lib.mkOption {
default = null;
type = timezone;
example = "America/New_York";
description = ''
The time zone used when displaying times and dates. See <https://en.wikipedia.org/wiki/List_of_tz_database_time_zones>
for a comprehensive list of possible values for this setting.
If null, the timezone will default to UTC and can be set imperatively
using timedatectl.
'';
};
hardwareClockInLocalTime = lib.mkOption {
default = false;
type = lib.types.bool;
description = "If set, keep the hardware clock in local time instead of UTC.";
};
};
location = {
latitude = lib.mkOption {
type = lib.types.float;
description = ''
Your current latitude, between
`-90.0` and `90.0`. Must be provided
along with longitude.
'';
};
longitude = lib.mkOption {
type = lib.types.float;
description = ''
Your current longitude, between
between `-180.0` and `180.0`. Must be
provided along with latitude.
'';
};
provider = lib.mkOption {
type = lib.types.enum [
"manual"
"geoclue2"
];
default = "manual";
description = ''
The location provider to use for determining your location. If set to
`manual` you must also provide latitude/longitude.
'';
};
};
};
config = {
environment.sessionVariables.TZDIR = "/etc/zoneinfo";
services.geoclue2.enable = lib.mkIf (lcfg.provider == "geoclue2") true;
# This way services are restarted when tzdata changes.
systemd.globalEnvironment.TZDIR = tzdir;
systemd.services.systemd-timedated.environment = lib.optionalAttrs (config.time.timeZone != null) {
NIXOS_STATIC_TIMEZONE = "1";
};
environment.etc = {
zoneinfo.source = tzdir;
}
// lib.optionalAttrs (config.time.timeZone != null) {
localtime.source = "/etc/zoneinfo/${config.time.timeZone}";
localtime.mode = "direct-symlink";
};
};
}
'''
# ---
# name: test_read_option_declaration_nixvim[asyncio]
'''
Reference: https://github.com/nix-community/nixvim/blob/main/modules/colorscheme.nix
Source: 17 lines
{ config, lib, ... }:
{
options = {
colorscheme = lib.mkOption {
type = lib.types.nullOr lib.types.str;
description = "The name of the colorscheme to use";
default = null;
};
};
config = lib.mkIf (config.colorscheme != "" && config.colorscheme != null) {
extraConfigVim = ''
colorscheme ${config.colorscheme}
'';
};
}
'''
# ---
# name: test_search_nix_stdlib[asyncio]
'''
Showing 20 of 83 functions:
• lib.textClosureMap
textClosureMap. lib.textClosureMap.
• lib.stringsWithDeps.textClosureMap
textClosureMap. lib.stringsWithDeps.textClosureMap.
• builtins.map
map. builtins.map. Primop. Takes 2 arguments. f, list. Apply the function f to each element in the list list. For exa...
• lib.map
map. lib.map. Primop. Takes 2 arguments. f, list. Apply the function f to each element in the list list. For example,...
• lib.lists.map
map. lib.lists.map. Primop. Takes 2 arguments. f, list. Apply the function f to each element in the list list. For ex...
• pkgs.testers.testEqualArrayOrMap
testEqualArrayOrMap. pkgs.testers.testEqualArrayOrMap. Functor.
• pkgs.testers.testEqualArrayOrMap.overrideDerivation
overrideDerivation. pkgs.testers.testEqualArrayOrMap.overrideDerivation.
• builtins.concatMap
concatMap. builtins.concatMap. Primop. Takes 2 arguments. f, list. Map and concatenate the result. Type. concatMap ::...
• lib.concatMap
concatMap. lib.concatMap. Primop. Takes 2 arguments. f, list. Map and concatenate the result. Type. concatMap :: (a -...
• lib.mapAttrsRecursiveCond
mapAttrsRecursiveCond. lib.mapAttrsRecursiveCond. Like mapAttrsRecursive, but it takes an additional predicate that t...
• pkgs.testers.testEqualArrayOrMap.override
override. pkgs.testers.testEqualArrayOrMap.override. Functor.
• lib.attrsets.mapAttrsRecursiveCond
mapAttrsRecursiveCond. lib.attrsets.mapAttrsRecursiveCond. Like mapAttrsRecursive, but it takes an additional predica...
• lib.lists.concatMap
concatMap. lib.lists.concatMap. Primop. Takes 2 arguments. f, list. Map and concatenate the result. Type. concatMap :...
• lib.mapAttrsRecursive
mapAttrsRecursive. lib.mapAttrsRecursive. Like mapAttrs, except that it recursively applies itself to the leaf attrib...
• lib.attrsets.mapAttrsRecursive
mapAttrsRecursive. lib.attrsets.mapAttrsRecursive. Like mapAttrs, except that it recursively applies itself to the le...
• lib.mapNullable
mapNullable. lib.mapNullable. Apply function if the supplied argument is non-null. Inputs. f Function to call. a Argu...
• lib.mapDerivationAttrset
mapDerivationAttrset. lib.mapDerivationAttrset. Apply a function to each derivation and only to derivations in an att...
• lib.concatMapStrings
concatMapStrings. lib.concatMapStrings. Map a function over a list and concatenate the resulting strings. Inputs. f 1...
• lib.trivial.mapNullable
mapNullable. lib.trivial.mapNullable. Apply function if the supplied argument is non-null. Inputs. f Function to call...
• lib.strings.concatMapStrings
concatMapStrings. lib.strings.concatMapStrings. Map a function over a list and concatenate the resulting strings. Inp...
'''
# ---
# name: test_search_options_homemanager[asyncio]
'''
Note: Version '25.11' not found, using 'unstable' instead.
Showing 20 of 36 options:
• programs.git.enable
Type: boolean
Whether to enable Git.
• programs.eza.git
Type: boolean
List each file's Git status if tracked or ignored ({option}`--git` argument).
• programs.difftastic.git.diffToolMode
Type: boolean
Whether to additionally configure difftastic as a git difftool.
When `false`, only `diff.external` is set (used for ...
• programs.bun.enableGitIntegration
Type: boolean
Whether to enable Git integration.
• programs.git-cliff.package
Type: null or package
The git-cliff package to use.
• programs.git.lfs.package
Type: null or package
The git-lfs package to use.
• programs.kitty.enableGitIntegration
Type: boolean
Whether to enable git integration.
• services.git-sync.package
Type: package
The git-sync package to use.
• programs.gh.settings.git_protocol
Type: string
The protocol to use when performing Git operations.
• programs.git-credential-keepassxc.package
Type: package
The git-credential-keepassxc package to use.
• programs.git-credential-oauth.package
Type: package
The git-credential-oauth package to use.
• programs.git-worktree-switcher.enable
Type: boolean
Whether to enable git-worktree-switcher.
• programs.git-worktree-switcher.package
Type: package
The git-worktree-switcher package to use.
• services.git-sync.enable
Type: boolean
Whether to enable git-sync services.
• services.git-sync.repositories.<name>.extraPackages
Type: list of package
Extra packages available to git-sync.
• programs.gh.gitCredentialHelper.enable
Type: boolean
Whether to enable the gh git credential helper.
• programs.git-cliff.enable
Type: boolean
Whether to enable git-cliff changelog generator.
• programs.git-credential-oauth.enable
Type: boolean
Whether to enable Git authentication handler for OAuth.
• programs.git.lfs.enable
Type: boolean
Whether to enable Git Large File Storage.
• programs.delta.enable
Type: boolean
Whether to enable delta, a syntax highlighter for git diffs.
'''
# ---
# name: test_search_options_nix_nomad[asyncio]
'''
Showing 20 of 804 options:
• job
Type: attribute set of (submodule)
An attrset of Nomad jobs, where attrset keys are the job name.
• job.<name>.affinities
Type: null or (list of (submodule))
• job.<name>.affinities.*.attribute
Type: null or string
• job.<name>.affinities.*.operator
Type: null or string
• job.<name>.affinities.*.value
Type: null or string
• job.<name>.affinities.*.weight
Type: null or signed integer
• job.<name>.allAtOnce
Type: null or boolean
• job.<name>.constraints
Type: null or (list of (submodule))
• job.<name>.constraints.*.attribute
Type: null or string
• job.<name>.constraints.*.operator
Type: null or string
• job.<name>.constraints.*.value
Type: null or string
• job.<name>.datacenters
Type: null or (list of string)
• job.<name>.group
Type: null or (attribute set of (submodule))
• job.<name>.group.<name>.affinities
Type: null or (list of (submodule))
• job.<name>.group.<name>.affinities.*.attribute
Type: null or string
• job.<name>.group.<name>.affinities.*.operator
Type: null or string
• job.<name>.group.<name>.affinities.*.value
Type: null or string
• job.<name>.group.<name>.affinities.*.weight
Type: null or signed integer
• job.<name>.group.<name>.constraints
Type: null or (list of (submodule))
• job.<name>.group.<name>.constraints.*.attribute
Type: null or string
'''
# ---
# name: test_search_options_nixos[asyncio]
'''
Found 1 options:
• time.timeZone
Type: null or string without spaces
The time zone used when displaying times and dates. See https://en.wikipedia.org/wiki/List_of_tz_database_time_zones...
'''
# ---
# name: test_search_options_nixvim[asyncio]
'''
Found 20 options:
• colorscheme
Type: null or string
The name of the colorscheme to use
• colorschemes.ayu.autoLoad
Type: boolean
Whether to automatically load ayu when neovim starts.
• colorschemes.ayu.enable
Type: boolean
Whether to enable ayu.
• colorschemes.ayu.lazyLoad
Type: submodule
Lazy-load settings for ayu.
[!WARNING]
This is an experimental option and may not work as expected with all plugi...
• colorschemes.ayu.lazyLoad.enable
Type: unspecified value
lazy-loading for ayu
• colorschemes.ayu.lazyLoad.settings
Type: lua value
Lazy provider configuration settings.
Check your lazy loading provider's documentation on settings to configure.
• colorschemes.ayu.luaConfig
Type: submodule
The plugin's lua configuration
• colorschemes.ayu.luaConfig.content
Type: strings concatenated with "\n"
Configuration of the plugin.
If pre and/or post are non-null, they will be merged using the order priorities
30...
• colorschemes.ayu.luaConfig.post
Type: null or strings concatenated with "\n"
Lua code inserted at the end of the plugin's configuration.
This is the same as using lib.nixvim.utils.mkAfterSectio...
• colorschemes.ayu.luaConfig.pre
Type: null or strings concatenated with "\n"
Lua code inserted at the start of the plugin's configuration.
This is the same as using lib.nixvim.utils.mkBeforeSec...
• colorschemes.ayu.package
Type: package
The ayu package to use.
• colorschemes.ayu.settings
Type: open submodule of attribute set of lua value
Options provided to the require('ayu').setup function.
• colorschemes.ayu.settings.mirage
Type: null or boolean or raw lua code
Set to true to use mirage variant instead of dark for dark background.
• colorschemes.ayu.settings.overrides
Type: null or lua code string or attribute set of (open submodule of (attribute set))
A dictionary of group names, each associated with a dictionary of parameters
( bg , fg , sp and style ) and color...
• colorschemes.bamboo.autoLoad
Type: boolean
Whether to automatically load bamboo when neovim starts.
• colorschemes.bamboo.enable
Type: boolean
Whether to enable bamboo.
• colorschemes.bamboo.lazyLoad
Type: submodule
Lazy-load settings for bamboo.
[!WARNING]
This is an experimental option and may not work as expected with all pl...
• colorschemes.bamboo.lazyLoad.enable
Type: unspecified value
lazy-loading for bamboo
• colorschemes.bamboo.lazyLoad.settings
Type: lua value
Lazy provider configuration settings.
Check your lazy loading provider's documentation on settings to configure.
• colorschemes.bamboo.luaConfig
Type: submodule
The plugin's lua configuration
'''
# ---
# name: test_search_package[asyncio]
'''
Showing 20 of 466 packages:
• git (0.3.0)
Git operations in haskell
• git (2.51.2)
Distributed version control system
• git-fork (2.57.1)
Git client
• zifter-git (0.0.0.1)
zifter-git
• perl5.38.2-Git (0.42)
This is the Git.pm, plus the other files in the perl/Git directory, from github's git/git
• perl5.40.0-Git (0.42)
This is the Git.pm, plus the other files in the perl/Git directory, from github's git/git
• git-annex (10.20251114)
manage files with git, without checking their contents into git
• git-remote-ipfs (0.1.0.0)
Git remote helper to store git objects on IPFS
• miss (0)
A Haskell git implimentation
• python3.13-gitpython (3.1.45)
Python Git Library
• gitea (1.25.2)
Git with a cup of tea
• python3.12-gitdb (4.0.12)
Git Object Database
• gitprompt-rs (0.4.1)
Simple Git prompt
• python3.12-gitpython (3.1.45)
Python Git Library
• python3.13-gitdb (4.0.12)
Git Object Database
• gitlog (0.0.beta)
Typesetting git changelogs
• coc-git (2.7.7)
Git integration of coc.nvim
• ocaml5.3.0-irmin-git (3.11.0)
Git backend for Irmin
• gipeda (0.3.3.2)
Git Performance Dashboard
• latexgit (54811)
A LaTeX git wrapper
'''
# ---
# name: test_show_option_details_homemanager_leaf[asyncio]
'''
Note: Version '25.11' not found, using 'unstable' instead.
Option: programs.git.enable
Type: boolean
Description: Whether to enable Git.
Default: false
Example: true
Reference: https://github.com/nix-community/home-manager/blob/master/modules/programs/git.nix (605 lines, use read_option_declaration to read)
'''
# ---
# name: test_show_option_details_homemanager_prefix[asyncio]
'''
Note: Version '25.11' not found, using 'unstable' instead.
'programs.git' has 21 child options:
• programs.git.attributes
Type: list of string
List of defining attributes set globally.
• programs.git.enable
Type: boolean
Whether to enable Git.
• programs.git.hooks
Type: attribute set of absolute path
Configuration helper for Git hooks.
See
for reference.
• programs.git.ignores
Type: list of string
List of paths that should be globally ignored.
• programs.git.includes
Type: list of (submodule)
List of configuration files to include.
• programs.git.includes.*.condition
Type: null or string
Include this configuration only when {var}`condition`
matches. Allowed conditions are described in
{manpage}`git-conf...
• programs.git.includes.*.contentSuffix
Type: string
Nix store name for the git configuration text file,
when generating the configuration text from nix options.
• programs.git.includes.*.contents
Type: attribute set of anything
Configuration to include. If empty then a path must be given.
This follows the configuration structure as described ...
• programs.git.includes.*.path
Type: string or absolute path
Path of the configuration file to include.
• programs.git.lfs.enable
Type: boolean
Whether to enable Git Large File Storage.
• programs.git.lfs.package
Type: null or package
The git-lfs package to use.
• programs.git.lfs.skipSmudge
Type: boolean
Skip automatic downloading of objects on clone or pull.
This requires a manual {command}`git lfs pull`
every time a n...
• programs.git.maintenance.enable
Type: boolean
Enable the automatic {command}`git maintenance`.
If you have SSH remotes, set {option}`programs.git.package` to a
gi...
• programs.git.maintenance.repositories
Type: list of string
Repositories on which {command}`git maintenance` should run.
Should be a list of absolute paths.
• programs.git.maintenance.timers
Type: attribute set of string
Systemd timers to create for scheduled {command}`git maintenance`.
Key is passed to `--schedule` argument in {comman...
• programs.git.package
Type: null or package
The git package to use. Use {var}`pkgs.gitFull`
to gain access to {command}`git send-email` for instance.
• programs.git.settings
Type: attribute set of attribute set of (string or boolean or signed integer or list of (string or boolean or signed integer) or attribute set of (string or boolean or signed integer or list of (string or boolean or signed integer)))
Configuration written to {file}`$XDG_CONFIG_HOME/git/config`.
See {manpage}`git-config(1)` for details.
• programs.git.signing.format
Type: null or one of "openpgp", "ssh", "x509"
The signing method to use when signing commits and tags.
Valid values are `openpgp` (OpenPGP/GnuPG), `ssh` (SSH), and...
• programs.git.signing.key
Type: null or string
The default signing key fingerprint.
Set to `null` to let the signer decide what signing key
to use depending on com...
• programs.git.signing.signByDefault
Type: null or boolean
Whether commits and tags should be signed by default.
• programs.git.signing.signer
Type: null or string
Path to signer binary to use.
'''
# ---
# name: test_show_option_details_nixos_leaf[asyncio]
'''
Option: time.timeZone
Type: null or string without spaces
Description: The time zone used when displaying times and dates. See https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
for a comprehensive list of possible values for this setting.
If null, the timezone will default to UTC and can be set imperatively
using timedatectl.
Default: null
Example: "America/New_York"
Reference: https://github.com/NixOS/nixpkgs/blob/nixos-25.11/nixos/modules/config/locale.nix (103 lines, use read_option_declaration to read)
'''
# ---
# name: test_show_option_details_nixos_prefix[asyncio]
'''
'time' has 2 child options:
• time.hardwareClockInLocalTime
Type: boolean
If set, keep the hardware clock in local time instead of UTC.
• time.timeZone
Type: null or string without spaces
The time zone used when displaying times and dates. See https://en.wikipedia.org/wiki/List_of_tz_database_time_zones...
'''
# ---
# name: test_show_option_details_nixvim[asyncio]
'''
Option: colorscheme
Type: null or string
Description: The name of the colorscheme to use
Default: null
Reference: https://github.com/nix-community/nixvim/blob/main/modules/colorscheme.nix (17 lines, use read_option_declaration to read)
'''
# ---
# name: test_show_option_details_with_reference[asyncio]
'''
Option: time.timeZone
Type: null or string without spaces
Description: The time zone used when displaying times and dates. See https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
for a comprehensive list of possible values for this setting.
If null, the timezone will default to UTC and can be set imperatively
using timedatectl.
Default: null
Example: "America/New_York"
Reference: https://github.com/NixOS/nixpkgs/blob/nixos-25.11/nixos/modules/config/locale.nix (103 lines, use read_option_declaration to read)
'''
# ---
# name: test_version_fallback[asyncio]
'''
Note: Version '99.99' not found, using 'unstable' instead.
Found 1 options:
• time.timeZone
Type: null or string without spaces
The time zone used when displaying times and dates. See https://en.wikipedia.org/wiki/List_of_tz_database_time_zones...
'''
# ---