mirror of
https://github.com/RGBCube/nu_scripts
synced 2025-08-01 06:37:46 +00:00
18 lines
521 B
Text
18 lines
521 B
Text
# Search nixpkgs and provide table output
|
|
export def ns [
|
|
term: string # Search target.
|
|
] {
|
|
|
|
let info = (
|
|
sysctl -n kernel.arch kernel.ostype
|
|
| lines
|
|
| {arch: ($in.0|str downcase), ostype: ($in.1|str downcase)}
|
|
)
|
|
|
|
nix search --json nixpkgs $term
|
|
| from json
|
|
| transpose package description
|
|
| flatten
|
|
| select package description version
|
|
| update package {|row| $row.package | str replace $"legacyPackages.($info.arch)-($info.ostype)." ""}
|
|
}
|