mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-24 05:44:13 +00:00
a1d3882307
What it does: line and column level *declaration* position information: $ nix repl . nix-repl> :p nixosConfigurations.micro.options.environment.systemPackages.declarationPositions [ { column = 7; file = "/nix/store/24aj3k7fgqv3ly7qkbf98qvphasrw9nb-source/nixos/modules/config/system-path.nix"; line = 63; } ] Use cases: - ctags over NixOS options, as will be presented at NixCon 2023 ;) - improving the documentation pages to go to the exact line of the declarations. Related work: - https://github.com/NixOS/nixpkgs/pull/65024 This one does it for all *definitions* rather than declarations, and it was not followed through with due to performance worries. - https://github.com/NixOS/nixpkgs/pull/208173 The basis for this change. This change is just a rebase of that one. I split it out to add the capability before adding users of it, in order to simplify review. However, the ctags script in there is a sample user of this feature. Benchmarks: conducted by evaluating my own reasonably complex NixOS configuration with the command: `hyperfine -S none -w 1 -- "nix eval .#nixosConfigurations.snowflake.config.system.build.toplevel.outPath"` ``` Benchmark 1: nix eval .#nixosConfigurations.snowflake.config.system.build.toplevel.outPath Time (mean ± σ): 8.971 s ± 0.254 s [User: 5.872 s, System: 1.388 s] Range (min … max): 8.574 s … 9.327 s 10 runs Benchmark 1: nix eval .#nixosConfigurations.snowflake.config.system.build.toplevel.outPath Time (mean ± σ): 8.766 s ± 0.160 s [User: 5.873 s, System: 1.346 s] Range (min … max): 8.496 s … 9.033 s 10 runs ``` Summary of results: it seems to be in the noise, this does not cause any visible regression in times. |
||
---|---|---|
.. | ||
disable-recursive | ||
functionTo | ||
types-anything | ||
adhoc-freeformType-survives-type-merge.nix | ||
alias-with-priority-can-override.nix | ||
alias-with-priority.nix | ||
attrsOf-conditional-check.nix | ||
attrsOf-lazy-check.nix | ||
class-check.nix | ||
declaration-positions.nix | ||
declare-attrsOf.nix | ||
declare-attrsOfSub-any-enable.nix | ||
declare-bare-submodule-deep-option-duplicate.nix | ||
declare-bare-submodule-deep-option.nix | ||
declare-bare-submodule-nested-option.nix | ||
declare-bare-submodule.nix | ||
declare-coerced-value-unsound.nix | ||
declare-coerced-value.nix | ||
declare-either.nix | ||
declare-enable-nested.nix | ||
declare-enable.nix | ||
declare-int-between-value.nix | ||
declare-int-positive-value-nested.nix | ||
declare-int-positive-value.nix | ||
declare-int-unsigned-value.nix | ||
declare-lazyAttrsOf.nix | ||
declare-mkPackageOption.nix | ||
declare-oneOf.nix | ||
declare-set.nix | ||
declare-submodule-via-evalModules.nix | ||
declare-submoduleWith-modules.nix | ||
declare-submoduleWith-noshorthand.nix | ||
declare-submoduleWith-path.nix | ||
declare-submoduleWith-shorthand.nix | ||
declare-submoduleWith-special.nix | ||
declare-variants.nix | ||
default.nix | ||
deferred-module-error.nix | ||
deferred-module.nix | ||
define-_module-args-custom.nix | ||
define-attrsOfSub-bar-enable.nix | ||
define-attrsOfSub-bar.nix | ||
define-attrsOfSub-foo-enable-force.nix | ||
define-attrsOfSub-foo-enable-if.nix | ||
define-attrsOfSub-foo-enable.nix | ||
define-attrsOfSub-foo-force-enable.nix | ||
define-attrsOfSub-foo-if-enable.nix | ||
define-attrsOfSub-foo.nix | ||
define-attrsOfSub-force-foo-enable.nix | ||
define-attrsOfSub-if-foo-enable.nix | ||
define-bare-submodule-values.nix | ||
define-enable-abort.nix | ||
define-enable-force.nix | ||
define-enable-throw.nix | ||
define-enable-with-custom-arg.nix | ||
define-enable-with-top-level-mkIf.nix | ||
define-enable.nix | ||
define-force-attrsOfSub-foo-enable.nix | ||
define-force-enable.nix | ||
define-freeform-keywords-shorthand.nix | ||
define-if-attrsOfSub-foo-enable.nix | ||
define-module-check.nix | ||
define-option-dependently-nested.nix | ||
define-option-dependently.nix | ||
define-settingsDict-a-is-b.nix | ||
define-shorthandOnlyDefinesConfig-true.nix | ||
define-submoduleWith-noshorthand.nix | ||
define-submoduleWith-shorthand.nix | ||
define-value-int-negative.nix | ||
define-value-int-positive.nix | ||
define-value-int-zero.nix | ||
define-value-list.nix | ||
define-value-string-arbitrary.nix | ||
define-value-string-bigint.nix | ||
define-value-string-properties.nix | ||
define-value-string.nix | ||
define-variant.nix | ||
disable-declare-enable.nix | ||
disable-define-enable-string-path.nix | ||
disable-define-enable.nix | ||
disable-enable-modules.nix | ||
disable-module-bad-key.nix | ||
disable-module-with-key.nix | ||
disable-module-with-toString-key.nix | ||
doRename-basic.nix | ||
doRename-warnings.nix | ||
emptyValues.nix | ||
extendModules-168767-imports.nix | ||
freeform-attrsOf.nix | ||
freeform-lazyAttrsOf.nix | ||
freeform-nested.nix | ||
freeform-str-dep-unstr.nix | ||
freeform-submodules.nix | ||
freeform-unstr-dep-str.nix | ||
import-configuration.nix | ||
import-custom-arg.nix | ||
import-from-store.nix | ||
merge-module-with-key.nix | ||
merge-typeless-option.nix | ||
module-argument-default.nix | ||
module-class-is-darwin.nix | ||
module-class-is-nixos.nix | ||
module-imports-_type-check.nix | ||
optionTypeFile.nix | ||
optionTypeMerging.nix | ||
raw.nix | ||
shorthand-meta.nix | ||
submoduleFiles.nix | ||
test-mergeAttrDefinitionsWithPrio.nix | ||
types.nix |