mirror of
https://github.com/Cian-H/dotfiles.git
synced 2026-01-06 00:51:57 +00:00
This change allows the dotfiles to work with chezmoi (e.g: on windows) and improves grepability with neovim/telescope
19 lines
521 B
Nu
19 lines
521 B
Nu
# 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)." ""}
|
|
}
|