ibraheemdev / modern-unix

A collection of modern/faster/saner alternatives to common unix commands.
30.62k stars 776 forks source link

A combined package collection / installer-script #5

Open munael opened 3 years ago

munael commented 3 years ago

Disclaimer: I've zero experience in preparing packages for any of the popular package managers for Linux.

How difficult would it be to make avail either a sort of collection package that points to these packages (e.g. as dependencies) for, say, Ubuntu?

Maintaining that sounds like a pain (but, see disclaimer). So how about a script (for each package manager, as appropriate/needed) that installs/updates each of these according to some optional CLI/file config?

Would be an interesting addition. Just putting it out there, even if this repo is likely not the place for it.

dlaehnemann commented 3 years ago

I would suggest something like conda-forge for the packaging, which then allows installation without admin privileges and on Windows, Linux and Mac OSX: https://conda-forge.org/

It would mean ensuring all the packages are in conda-forge individually, and they could then be installed into a joint environment using conda or its faster drop-in replacement mamba. With the latter, creating a named environment tools for the tools already on conda-forge is as easy as the following (after having installed mamba):

mamba create -n tools bat exa broot ripgrep fzf jq cheat glances hyperfine httpie zoxide

To use the tools, you just have to activate the respective environment with:

conda activate tools

And you can of course create separate environments for separate sets of tools, whichever you often use together. I went through all the packages currently in the list and a bunch are already on conda-forge. Everything that has a link, is are already there:

For each of the linked packages, a quick install help could be included in the list, with a linkout to mamba installation to get you going.

For some of the other packages, they seem to be packaged for Debian, at least. So one could do a similar search and include relevant info in the list wherever that is the case. And then it's simply a question of contributions from users of different platforms to fill the installation info.

yozachar commented 3 years ago

How about docker?

I'm learning about all these cools stuff so I'm still green. Suppose I want these commands on a *nix-based system, how can I achieve that?

Docker would be a cross platform solution. A docker file instructs to pull appropriate binaries from individual repositories (suppose they provide one) and then places them in path. If binaries don't exists then the docker file can instruct to initiate a GitHub action or CI/CD pipeline to build binaries (that might be messy).

PS: It looks like a stupid idea.. but nonetheless exciting..

dlaehnemann commented 3 years ago

I find that Docker usually leads to a lot of overhead. First of all, you have to get Docker to run on your system, which has been cumbersome for me in the past (haven't tried recently, though). And then you drag along a full operating system just to get a couple of programs to run. And you will only be able to operate inside the Docker container. So I think Docker is good if you want to make a system reproducible, but cumbersome when you just want things to work on the command line (which I think these tools are meant to).

For getting things to work easily, I really like the conda / mamba system. Easy to setup and easy to use. And most things on conda-forge are truly cross-platform.

yozachar commented 3 years ago

Ah thanks for the input. I don't think you've to have a whole OS layer to install docker apps.. (I need a double check though). Conda is great but then again I have had some dependency issues and the conda env needs to be active right.. I'm looking for something like npm or pdm, but one is for JS and other Python... mm.

dlaehnemann commented 3 years ago

Basically, conda / mamba is something like npm, just agnostic of languages. So you can package anything for it. And isolating environments from each other is actually a great plus in my view -- you can use it to install tools into separate environments, whose dependencies conflict. That is something you can't do with a package manager that installs everything system-wide. But I think we're trailing off-topic, here... :sweat_smile:

ebb-earl-co commented 3 years ago

Instead of Docker, if you're on Fedora like me you could make a toolbox out of all of the tools in this repository. As the name implies,

Toolbox makes it easy to use a containerized environment for everyday software development and debugging ... In other words, toolbox containers look, feel and behave like a standard Linux command line environment.

So you get the benefit of containerization (using Podman under the hood which is arguably more lightweight than Docker) at the same time as the benefit of your own, cozy command-line environment with all of these modern Unix tools.

ibraheemdev commented 3 years ago

I'm spoiled by pacman and the AUR so I don't really have a need for this :smile: It's an interesting idea though.

juliosueiras commented 3 years ago

another candidate could be nix, since it work on almost any distro(fedora silverblue will require workaround using this though)

and all the currently listed tools are in the repo already

example:

shell.nix

with import <nixpkgs> {};

mkShell {
  buildInputs = [
    bat
    exa
    lsd
    delta
    dust
    duf
    broot
    fd
    ripgrep
    ag
    fzf
    mcfly
    choose
    jq
    sd
    cheat
    tldr
    bottom
    glances
    gtop
    hyperfine
    gping
    procs
    httpie
    curlie
    xh
    zoxide
    dogdns
  ];
}

and run nix-shell (this is also a disposable shell)

Demo: (from fresh ubuntu)

asciicast

ebb-earl-co commented 3 years ago

@juliosueiras I've head about NixOS and especially its manager that you show here, but man is this cool and exactly in line with what I imagined! A couple of questions, though:

  1. What does vagrant ssh, your first command in the above video (GIF?), do?
  2. How in the world did you make a video (or GIF?) that allows me to copy the text from the video!? That felt like magic
  3. When you say that running nix-shell is disposable, do you mean that all of the dependencies are download in a temporary directory, or is it something particular to Nix that I don't have a feeling for?
juliosueiras commented 3 years ago

1) vagrant ssh is just to show case that I am in a clean fresh ubuntu (vagrant is a tool to create/manage vms), since the purpose to show how to use it from a clean ubuntu with no nix installed

2) asciinema

3) all the deps are under /nix/store , so if you do nix-shell again, it won't need to redownload it, and the /nix/store is created as part of the nix installation process, lastly, if you do want remove the actual deps files you can just do nix-collect-garbage

ebb-earl-co commented 3 years ago

@juliosueiras amazing, thank you for the information. Looks like it's time to learn some Nix, because it exactly fits the bill for making a container-like environment for all of the modern-unix tools!