sh1marin on Nostr: TIL: nix search 只会搜索最顶层的 attr set 里有没有 type == ...
TIL: nix search 只会搜索最顶层的 attr set 里有没有 type == derivation,会遇到其无法展示某个子 attribute set 里的 derivation 定义。这种情况下如果想搜索某个子 attr set 里的 derivation,可以从上到下的加上一个 attribute recurseForDerivation = true,然后 nix search 就会往里搜了。
比如说 { a = drv; b = { c = drv; }; },可以在顶层加上上述 attribute,变成 { recurseForDerivation = true; a = drv; b = { c = drv; }; } 之后,用 nix search 就能展示 b.c 这个 derivation 了。
Published at
2024-01-03 16:14:02Event JSON
{
"id": "8684f1cc73a43d1e1eed187d9d1fcd1fcdf8593ed09ba0301891626898cdbb4a",
"pubkey": "71ea5c9d9ef4f01c1ecb1a116f7d15ffb26a241620bf28c856593523a5e8edcb",
"created_at": 1704298442,
"kind": 1,
"tags": [
[
"proxy",
"https://dabr.ca/objects/b295f5c0-69de-407b-aad1-81d6e725af6f",
"activitypub"
]
],
"content": "TIL: nix search 只会搜索最顶层的 attr set 里有没有 type == derivation,会遇到其无法展示某个子 attribute set 里的 derivation 定义。这种情况下如果想搜索某个子 attr set 里的 derivation,可以从上到下的加上一个 attribute recurseForDerivation = true,然后 nix search 就会往里搜了。\n\n比如说 { a = drv; b = { c = drv; }; },可以在顶层加上上述 attribute,变成 { recurseForDerivation = true; a = drv; b = { c = drv; }; } 之后,用 nix search 就能展示 b.c 这个 derivation 了。",
"sig": "958f66881e13a650b2fe05d3ac3aa5d9598e580937d127d251eb69196a233dd69ec033dea18bfe58cb48ce8e1455f662a90e84e50e66690eb64828956b0f8d3e"
}