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

nixos/docs: add a ctags script for nixos options #208173

Closed
wants to merge 4 commits into from
Closed

Conversation

lf-
Copy link
Member

@lf- lf- commented Dec 29, 2022

Description of changes

This is basically the change made by #65024

This branch is very WIP and I'm frankly not sure when I'll get back to it. For instance, I'm not sure where to put the script in the tree right now as it's late and I'm tired.

to use it:

$ nix eval --raw --expr '(import ./opts-tags.nix).tags' --impure > opts-tags

then you can configure your editor, for instance with 'tags' in vim, to load tags from that file (as well as nix-doc generated nix function ctags!)

output looks like this:

dev/nixpkgs - [nixos-tags●] » head opts-tags
_module.args    /home/jade/dev/nixpkgs/lib/modules.nix  157
_module.check   /home/jade/dev/nixpkgs/lib/modules.nix  221
_module.freeformType    /home/jade/dev/nixpkgs/lib/modules.nix       228
_module.specialArgs     /home/jade/dev/nixpkgs/lib/modules.nix       244
appstream.enable        /home/jade/dev/nixpkgs/nixos/modules/config/appstream.nix    6
assertions      /home/jade/dev/nixpkgs/nixos/modules/misc/assertions.nix     9
Things done
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 23.05 Release Notes (or backporting 22.11 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
    • (Release notes changes) Ran nixos/doc/manual/md-to-db.sh to update generated release notes
  • Fits CONTRIBUTING.md.

@lf-
Copy link
Member Author

lf- commented Dec 29, 2022

things that should be fixed up:

  1. perf testing
  2. don't break api: rename functions into wrappers
  3. decide if the design of putting it as an argument is a good idea
  4. make the format of the metadata the same as the existing definitionsWithPositions, rather than having a new one; make it compatible with that one. if we did that then we should rename the option as "precise locations" or something like that.
  5. perf testing, since that sank the last attempt, probably
  6. actually test it's the right format for ctags because i kinda didn't try putting it into the editor yet; the format is somewhere on :help tag in vim.
  7. move it to a more appropriate location, make a wrapper script for the nix eval command

@github-actions github-actions bot added 6.topic: module system About "NixOS" module system internals 6.topic: lib The Nixpkgs function library labels Aug 15, 2023
lf- added a commit to lf-/nixpkgs that referenced this pull request Aug 15, 2023
What it does: line and column level *declaration* position information:

$ nix repl .
nix-repl> :p nixosConfigurations.micro.options.environment.systemPackages.declarationsWithLocations
[ { 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:
- NixOS#65024

  This one does it for all *definitions* rather than declarations, and
  it was not followed through with due to performance worries.
- NixOS#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.
lf- added a commit to lf-/nixpkgs that referenced this pull request Aug 15, 2023
What it does: line and column level *declaration* position information:

$ nix repl .
nix-repl> :p nixosConfigurations.micro.options.environment.systemPackages.declarationsWithLocations
[ { 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:
- NixOS#65024

  This one does it for all *definitions* rather than declarations, and
  it was not followed through with due to performance worries.
- NixOS#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.
lf- added a commit to lf-/nixpkgs that referenced this pull request Aug 15, 2023
What it does: line and column level *declaration* position information:

$ nix repl .
nix-repl> :p nixosConfigurations.micro.options.environment.systemPackages.declarationsWithLocations
[ { 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:
- NixOS#65024

  This one does it for all *definitions* rather than declarations, and
  it was not followed through with due to performance worries.
- NixOS#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.
@lf- lf- mentioned this pull request Aug 15, 2023
12 tasks
lf- added a commit to lf-/nixpkgs that referenced this pull request Aug 20, 2023
What it does: line and column level *declaration* position information:

$ nix repl .
nix-repl> :p nixosConfigurations.micro.options.environment.systemPackages.declarationsWithLocations
[ { 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:
- NixOS#65024

  This one does it for all *definitions* rather than declarations, and
  it was not followed through with due to performance worries.
- NixOS#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.
lf- added a commit to lf-/nixpkgs that referenced this pull request Aug 28, 2023
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:
- NixOS#65024

  This one does it for all *definitions* rather than declarations, and
  it was not followed through with due to performance worries.
- NixOS#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.
lf- added a commit to lf-/nixpkgs that referenced this pull request Aug 29, 2023
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:
- NixOS#65024

  This one does it for all *definitions* rather than declarations, and
  it was not followed through with due to performance worries.
- NixOS#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.
@lf- lf- closed this Aug 29, 2023
lf- added a commit to lf-/nixpkgs that referenced this pull request Aug 29, 2023
This is rather a strawman of a PR to try to figure out the best spot to
put this code and the documentation of how to use it. I don't really
know.

Sample content:
```
!_TAG_FILE_SORTED	1	1
!_TAG_FILE_ENCODING	utf-8	1
_module.args	/home/jade/dev/nixpkgs/lib/modules.nix	122
_module.check	/home/jade/dev/nixpkgs/lib/modules.nix	186
_module.freeformType	/home/jade/dev/nixpkgs/lib/modules.nix	193
_module.specialArgs	/home/jade/dev/nixpkgs/lib/modules.nix	209
appstream.enable	/home/jade/dev/nixpkgs/nixos/modules/config/appstream.nix	6
assertions	/home/jade/dev/nixpkgs/nixos/modules/misc/assertions.nix	9
boot.binfmt.emulatedSystems	/home/jade/dev/nixpkgs/nixos/modules/system/boot/binfmt.nix	272
```

Sample usage (can be used in parallel with `nix-doc tags`):
```
nix build -f nixos/release.nix optionsCtags -o opts-tags
(in vim): :set tags+=opts-tags
          :tj boot.binfmt.emulatedSystems
```

This PR depends on and contains NixOS#249243. Marked as draft till that's
worked out. This PR pair replaces NixOS#208173.
lf- added a commit to lf-/nixpkgs that referenced this pull request Aug 30, 2023
This is rather a strawman of a PR to try to figure out the best spot to
put this code and the documentation of how to use it. I don't really
know.

Sample content:
```
!_TAG_FILE_SORTED	1	1
!_TAG_FILE_ENCODING	utf-8	1
_module.args	/home/jade/dev/nixpkgs/lib/modules.nix	122
_module.check	/home/jade/dev/nixpkgs/lib/modules.nix	186
_module.freeformType	/home/jade/dev/nixpkgs/lib/modules.nix	193
_module.specialArgs	/home/jade/dev/nixpkgs/lib/modules.nix	209
appstream.enable	/home/jade/dev/nixpkgs/nixos/modules/config/appstream.nix	6
assertions	/home/jade/dev/nixpkgs/nixos/modules/misc/assertions.nix	9
boot.binfmt.emulatedSystems	/home/jade/dev/nixpkgs/nixos/modules/system/boot/binfmt.nix	272
```

Sample usage (can be used in parallel with `nix-doc tags`):
```
nix build -f nixos/release.nix optionsCtags -o opts-tags
(in vim): :set tags+=opts-tags
          :tj boot.binfmt.emulatedSystems
```

This PR depends on and contains NixOS#249243. Marked as draft till that's
worked out. This PR pair replaces NixOS#208173.
lf- added a commit to lf-/nixpkgs that referenced this pull request Sep 8, 2023
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:
- NixOS#65024

  This one does it for all *definitions* rather than declarations, and
  it was not followed through with due to performance worries.
- NixOS#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.
lf- added a commit to lf-/nixpkgs that referenced this pull request Sep 8, 2023
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:
- NixOS#65024

  This one does it for all *definitions* rather than declarations, and
  it was not followed through with due to performance worries.
- NixOS#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.
github-actions bot pushed a commit to arcnmx/nixpkgs-lib that referenced this pull request Sep 18, 2023
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:
- NixOS/nixpkgs#65024

  This one does it for all *definitions* rather than declarations, and
  it was not followed through with due to performance worries.
- NixOS/nixpkgs#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.
github-actions bot pushed a commit to nix-community/nixpkgs.lib that referenced this pull request Sep 24, 2023
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:
- NixOS/nixpkgs#65024

  This one does it for all *definitions* rather than declarations, and
  it was not followed through with due to performance worries.
- NixOS/nixpkgs#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.
lf- added a commit to lf-/nixpkgs that referenced this pull request Jan 7, 2024
This is rather a strawman of a PR to try to figure out the best spot to
put this code and the documentation of how to use it. I don't really
know.

Sample content:
```
!_TAG_FILE_SORTED	1	1
!_TAG_FILE_ENCODING	utf-8	1
_module.args	/home/jade/dev/nixpkgs/lib/modules.nix	122
_module.check	/home/jade/dev/nixpkgs/lib/modules.nix	186
_module.freeformType	/home/jade/dev/nixpkgs/lib/modules.nix	193
_module.specialArgs	/home/jade/dev/nixpkgs/lib/modules.nix	209
appstream.enable	/home/jade/dev/nixpkgs/nixos/modules/config/appstream.nix	6
assertions	/home/jade/dev/nixpkgs/nixos/modules/misc/assertions.nix	9
boot.binfmt.emulatedSystems	/home/jade/dev/nixpkgs/nixos/modules/system/boot/binfmt.nix	272
```

Sample usage (can be used in parallel with `nix-doc tags`):
```
nix build -f nixos/release.nix optionsCtags -o opts-tags
(in vim): :set tags+=opts-tags
          :tj boot.binfmt.emulatedSystems
```

This PR depends on and contains NixOS#249243. Marked as draft till that's
worked out. This PR pair replaces NixOS#208173.
lf- added a commit to lf-/nixpkgs that referenced this pull request Jan 7, 2024
This is rather a strawman of a PR to try to figure out the best spot to
put this code and the documentation of how to use it. I don't really
know.

Sample content:
```
!_TAG_FILE_SORTED	1	1
!_TAG_FILE_ENCODING	utf-8	1
_module.args	/home/jade/dev/nixpkgs/lib/modules.nix	122
_module.check	/home/jade/dev/nixpkgs/lib/modules.nix	186
_module.freeformType	/home/jade/dev/nixpkgs/lib/modules.nix	193
_module.specialArgs	/home/jade/dev/nixpkgs/lib/modules.nix	209
appstream.enable	/home/jade/dev/nixpkgs/nixos/modules/config/appstream.nix	6
assertions	/home/jade/dev/nixpkgs/nixos/modules/misc/assertions.nix	9
boot.binfmt.emulatedSystems	/home/jade/dev/nixpkgs/nixos/modules/system/boot/binfmt.nix	272
```

Sample usage (can be used in parallel with `nix-doc tags`):
```
nix build -f nixos/release.nix optionsCtags -o opts-tags
(in vim): :set tags+=opts-tags
          :tj boot.binfmt.emulatedSystems
```

This PR depends on and contains NixOS#249243. Marked as draft till that's
worked out. This PR pair replaces NixOS#208173.
philiptaron pushed a commit to philiptaron/nixpkgs that referenced this pull request Mar 4, 2024
This is rather a strawman of a PR to try to figure out the best spot to
put this code and the documentation of how to use it. I don't really
know.

Sample content:
```
!_TAG_FILE_SORTED	1	1
!_TAG_FILE_ENCODING	utf-8	1
_module.args	/home/jade/dev/nixpkgs/lib/modules.nix	122
_module.check	/home/jade/dev/nixpkgs/lib/modules.nix	186
_module.freeformType	/home/jade/dev/nixpkgs/lib/modules.nix	193
_module.specialArgs	/home/jade/dev/nixpkgs/lib/modules.nix	209
appstream.enable	/home/jade/dev/nixpkgs/nixos/modules/config/appstream.nix	6
assertions	/home/jade/dev/nixpkgs/nixos/modules/misc/assertions.nix	9
boot.binfmt.emulatedSystems	/home/jade/dev/nixpkgs/nixos/modules/system/boot/binfmt.nix	272
```

Sample usage (can be used in parallel with `nix-doc tags`):
```
nix build -f nixos/release.nix optionsCtags -o opts-tags
(in vim): :set tags+=opts-tags
          :tj boot.binfmt.emulatedSystems
```

This PR depends on and contains NixOS#249243. Marked as draft till that's
worked out. This PR pair replaces NixOS#208173.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant