![]() ![]() Use help commands to list all available commands (I'm limiting to 5 between there are a lot of commands) f, -find - string to find in command names, usage, and search terms Use help a-command to learn from a single command: Help from nushell can be parsed directly with nu commands, it's important to understand where to find information about commands. The documentation is still required to learn the many commands and syntax, but examples are a nice introduction. If you are like me, and you prefer learning by doing instead of reading a lot of documentation, I prepared a bunch of real world use case you can experiment with. config/nushell/config.nu and set it to true. The only change I made from now is to make Tab completion case-sensitive, so D completes to Downloads instead of asking between dev and Downloads. Nushell documentation: Building nushell from sources Configuration §Īt first run, you are prompted to use default configuration files, I'd recommend accepting, you will have files created in ~/.config/nushell/. With Nix, it's packaged under the name nushell, the binary name is nu.įor other platforms, it's certainly already packaged, otherwise you can find installation instructions to build it from sources. I packaged it for OpenBSD, so it's available on -current (and will be in releases after 7.3 is out), the port could be used on 7.2 with no effort. Nushell is a rust program, so it should work on every platform where Rust/Cargo are supported. Nushell documentation website How to get it § Nushell handles correctly this situation as its manipulates the data using indexed entries, given you correctly parsed the input at the beginning. With a regular shell, iterating over a command output can be complex when it involves spaces or newlines, for instance, that's why find and xargs have a -print0 parameter to have a special delimited between "items", but it doesn't compose well with other tools. ![]() You may want to try nushell only as a tool, and not as your main shell, it's perfectly fine. It's a good tool for creating robust data manipulation pipelines, you can think of it like a mix of a shell which would include awk's power, behave like a SQL database, and which knows how to import/export XML/JSON/YAML/TOML natively. It's called nushell and is a non-POSIX shell, so most of your regular shells knowledge (zsh, bash, ksh, etc…) can't be applied on it, and using it feels like doing functional programming. Let me introduce you to a nice project I found while lurking on the Internet. Tags:Ĭomments on Fediverse/Mastodon What is nushell § Nushell: Introduction to a new kind of shell This was really complicated to figure how to replicate this with nixpkgs. This task is natively supported in the OpenBSD tool building packages (dpb), it can fetch multiples files in parallel and automatic remove files that aren't used anymore. It's currently not possible to easily trim distfiles that aren't useful anymore, I plan to maybe add it someday. I still need to figure how to get a full list of all the packages, I currently have a work in progress relying on nix search -json but it doesn't work on 100% of the packages for some reasons. To delete a file from the store, remove its symlink and run the garbage collector. The symlinks are very important as they will prevent garbage collection from the store, and it's also used internally to quickly check if a file is already in the store. This will create a directory distfiles containing symlinks to the sources files stored in the store. The command run.sh will generate a JSON structure containing all the dependencies used by the packages listed as arguments, and the script will iterate over the JSON list and use nix's fetcher to gather the sources in the nix store, verifying the checksum on the go. You must run it on a system with nix installed.Īfter cloning and 'cd-ing' into the directory, simply run. Nixpkgs-mirror-tarballs project page How to use it § It's not that absolutely useful for everyone, but it's always important to have such tools available. Why would you like to keep a local copy? If upstream disappear, you can't get access to the sources anymore, except maybe in Hydra, but you rely on a third party to access the sources, so it's still valuable to have local copies of software you care about, just to make copies. I would like to present you a project I made to easily download all the sources files required to build packages from nixpkgs, allowing to keep offline copies. This may appear like a very niche use case, in my quest of software conservancy for nixpkgs I didn't encounter many people understanding why I was doing this. Comments on Fediverse/Mastodon Introduction § ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |