Kiss Linux – A distribution with a focus on less is more
k1ss.org
k1ss.org
"How do I remove a package and all of its dependencies? [...] The package manager does not do recursive dependency removal on removal of a package. This error-prone automation will not be added to the package manager. "
On every distro uninstalling packages never really reverts the system to its previous state, always leaves some junk behind.
That's not true at all. See Nix package manager (and NixOS the distro).
$ realpath /etc/fstab
/nix/store/06k708q78zxw8922rrrc8mmp5gbin4am-etc-fstab
However, NixOS installations can also end up accumulating configuration and state files that stick around when they are not defined declaratively. E.g. if you enable ssh, host keys are generated in /etc/ssh. Even if you disable ssh, these files will stick around.You can avoid such accidental state [1], since NixOS will happily boot from a filesystem with just /boot and /nix and reconstruct the rest upon system activation. But it is quite a bit of work, since you need to manually specify what state you want to preserve (e.g. SSH host key files). Also, it currently does not work nicely with some systemd units that barf out if you make /var/run entries symlinks.
For the moment I’m doing this on MacOS with the nix package manager. I’ll eventually move to NixOS. I tried to run NixOS in VirtualBox, but couldn’t get screen resizing to work despite using the official ISO which is supposed to have the appropriate extensions installed.
My current hurdle is exactly the topic of this thread: non-binary configs. For example, what am I supposed to do with .zprofile? I think I’m supposed to write a custom Nix derivation for ZSH that includes any and all customizations. I’m concerned that might cause problems with MacOS system ZSH. I can probably fix that with a custom login shell?
Anyway it’s fun, but complicated and diversely documented. Gonna take a while to sort it all out.
I use both NixOS and macOS. You can take two routes: 1. you can continue using Apple's /bin/zsh and just use a .zprofile generated using Nix (e.g. home-manager). Generally, the differences between zsh versions are not that large and it just works. This is what I have been doing with my Mac. 2. You could change your shell, either system-wide, or just for Terminal.app to ~/.nix-profile/bin/zsh.
I’ll eventually move to NixOS. I tried to run NixOS in VirtualBox, but couldn’t get screen resizing to work despite using the official ISO which is supposed to have the appropriate extensions installed.
If you have some leftover hardware, try it! NixOS is a different experience altogether and cannot be paralleled by Nix on macOS or a Linux distribution. Being able to declaratively define your whole system is insanely cool and powerful. Fully reproducible machines. Also, you can try out stuff without any harm. Just switch back to the previous working generation (or try the configuration in a VM with nixos-rebuild build-vm) if you are not happy.
Nix supports lots of approaches, with a varying degree of "buy in". I wouldn't say you're "supposed" to do one thing or another, although some things would definitely be non-Pareto-optimal (i.e. you could achieve all the same benefits with fewer downsides).
In the case of .zprofile, I would consider any of the following to be reasonable:
- A normal config file sitting on your machine, edited as needed, not version controlled.
- A symlink to a git repo of configs/dotfiles (this is what I do)
- Directly version-controlling your home dir in some way
- Writing the config content as a string in a Nix file, and having Nix put it in place upon rebuild (I do this with files in /etc)
- Having a Nix 'activation script' which copies/symlinks config files into place (this is what I do, to automate symlinking things to my dotfiles repo)
- Wrapping/overriding the package such that it always loads the desired config (e.g. by replacing the binary with a wrapper which prepends a "use this config" flag).
--
The following has nothing to do with your question, but I felt like ranting about a tangentially-related topic; it's not directed at you ;)
I often see "extremism" when Nix is brought up; e.g. if someone wants help managing non-Python dependencies of their Python app, and someone recommends trying Nix, it's often dismissed along the lines of "I don't have time to throw away my whole setup and start over with the Nix way of doing things, even if were better". The thing is, using Nix can actually be as simple as:
(import <nixpkgs> {}).runCommand "my-app" {} ''
Put any arbitrary bash commands here
''
I often treat Nix like "Make, but with snapshots". Nix 2.0 turned on 'sandboxing' by default, but if you turn that off you can do what you like: add '/usr/bin' to the PATH, 'wget' some arbitrary binaries into '/var', etc. You won't get the benefits of deterministic builds, rollbacks, concurrent versions, etc. but those don't matter if the prior method didn't have them either. Projects like Nixpkgs, and the experimental things people write about on their blogs, aren't the only way to do things; you don't have to throw the baby out with the bathwater.Not at all. Apt has been able to remove everything for the last 20 years.
Not really. It can remove configuration files etc. it knows about, but it can't know about files later created by the application itself.
That's also not what's being asked for here. The basic request is this: track which packages were manually vs automatically installed, and give the user the ability to remove automatically-installed orphans whose manually-installed reverse-dependencies are no longer installed. This is what APT does and it works fine 99% of the time.
EDIT: I'm wrong, see below.
This is explicit rather than implicit but it works even on one package.
> To remove a package and its dependencies which are not required by any other installed package:
> # pacman -Rs package_name
> To remove a package, its dependencies and all the packages that depend on the target package:
> # pacman -Rsc package_name
This list may include Firefox and other "end" software so a brain is required when parsing the list. You'll come to learn the relationships between packages and their dependencies and this will eventually become effortless.
Habitat (hab), nix, and others IIRC do SxS package mgmt.
Everything Should Be Made as Simple as Possible, But Not Simpler - possibly paraphrasing Einstein
Another elegant way, for a more civilized time, is to simply disallow dependencies. If none of your packages has any dependencies, then no dependency hell is ever possible. This is possible and easy with static executables (for binary packages), and by embedding the interpreter of packages written in scripting languages.
App::staticperl will build a static binary with the perl+C dependencies built in.
A lot of the time, it's better to use a plenv + Carton, mind, but if you want a single file for deployment, that's a solved problem in perl land too and has been for years.
while kiss orphans | grep -qv $HOSTNAME; do
kiss remove `kiss orphans | grep -v $HOSTNAME | tr '\n' ' '`
done
This was much easier to implement in kiss than other package manager extensions in previous distros I've maintained packges for (gentoo, exherbo, arch, debian). sudo pacman -Rns $(pacman -Qqdtt)
Done.Deal breaker for me. But the author should be commended for stating it up front. Far to often, only the benefits are presented but none of the flaws so you have to investigate new tech deeply to find out if it is right for you.
Seriously, though, I'm curious how many people running Linux for dev or admin purposes really care about non-English i18n. Even just 'en_US' seems to cause regular problems for me.
I'm not familiar enough with the internals of XBPS to compare it with apt or yum or pacman, but it seems to work quite well.
I have also found the community around Void to be quite welcoming.
1 super-small nit to pick: the sub-title "..a focus on less is more.." I took that way too literally and thought it was referencing the tool `less` and was expecting it to have used less as a wrapper for everything. (call it a brain fart, and lack of caffeine)
I FUCKING LOVE YOUR WEB PAGE.
Thank-you so fucking much for reminding people and showing that simple is beautiful. Everything is clear, obvious and legible.
% cksum `which less` `which more`
2677110273 146976 /usr/bin/less
2677110273 146976 /usr/bin/more jack@jackdesktop ~ [1]> bash -c "cksum `which less` `which more`"
3407085100 179664 /usr/bin/less
110370394 38816 /usr/bin/more
jack@jackdesktop ~>Not a symlink (or even a hard link) on my OS X laptop, but the same executable.
On my OpenBSD systems, they're hard links.
On my Ubuntu system, they're separate.
Enough to get 20 bugs :-). I wish there was a good standard alternative to bash (sh in this case) for shell programming.
Otherwise I like the spirit, it's a good match with collapse os ;-)
There is perl! :)
I wish there was a language with the ubiquity of Bash but modern and safe.
I agree. But reaching such a point would be hard. Not impossible, but hard.
I think the main problem would be to gain traction for an alternative. Because if one questions the status quo, then there are tons of alternative paths to go by. But which of them are viable…? It’s not easy to pick a winner in this kind of situtation. And most people, even in tech, would not want to spend hours on trying out/developing a new shell that won’t gain any significant traction.
The Bourne shell was developed in the mid 70s. There were not many other scripting languages around then, so Bourne shell became a major player. They could probably have used Lisp if they wanted to, but AFAIK Lisp was not widespread within the Unix world back then.
These days we have many other models for interpreted languages. Ruby, Python, Perl, TCL, Scheme, Clojure, etc etc.
Let’s say someone wrote a Python-inspired shell that aimed to replace sh/Bash. Now you need to gain traction in order to build up a useful and sound ecosystem that has the ability to replace all those shell scripts out there. But how would you convince the Ruby fans or Scheme fans to use that? Therein lies a big challenge.
Getting people to continue using sh is not as hard, since it at least is standard, despite its shortcomings.
[Slightly edited.]
https://github.com/oilshell/oil
A new Unix shell. Our upgrade path from bash to a better language.
It runs thousands of lines of existing shell scripts unmodified, but there's also a brand new language that will be familiar to Python or JS programmers. See http://www.oilshell.org/blog/2020/01/simplest-explanation.ht...
It works and you can try it now. The downside is that the implementation is more like a slow prototype, but that's being addressed, and the release I made today has stats about the C++ version (blog post forthcoming).
It's basically my least favorite language for "real" programs, but I think it could find a niche for scripting in the middle of the spectrum between (ba)sh and python.
(0 open, 85 closed BTW)
On Windows: ren ∗.js ∗.mjs
On Unix: for x in ∗.js; do mv "$x" "${x%.js}.mjs"; done
Feels like shells should have one line list comprehensions without the obtruse do/done. Are there any shell enhancements like zsh or the like, that make simple list operations less verbose?
https://pubs.opengroup.org/onlinepubs/009695399/functions/re...
mv is basically just a shim over rename so I don't see your point.
Shell may be to glue things together but it's supposed to also be a decent language for doing file/filename related things.
I would say Tcl!
Tcl is one of the most underrated programming language that everybody probably has installed. It has existed for as long as ksh and even long before bash. It is simple and powerful enough that first version of Redis were written in it[1].
MacPorts is written in Tcl (including its ports DSL) and I enjoyed every moment working with it.
[1]: https://gist.github.com/antirez/6ca04dd191bdb82aad9fb241013e...
The syntax takes some adjustment because it's not lval/rval-based, which is maybe why it's not so widely used now. But if you want a language that's more robust than shell and more minimal than Python, consider TCL for your next project.
But if you contextualize it a bit differently I think you might find it is super valuable.
One of the challenges the Linux community has is that there are so many distributions or 'distros' to choose from. What is more, the feature sets of those distros form a non-planar non-directed graph of nodes for which it is very very difficult to reason about their feature content.
Consider for the moment if you could reason about distros like you can reason about genomes. In modern genetics we can look at flora, fauna, bacteria, etc and talk about them as a base class "foo" with specific genetic changes that get them to be a "bar", we can talk about speciation where the genetics are different enough such that hybrids are infertile or impossible.
This effort tries, and I think largely succeeds, in capturing the "minimum viable Linux system" (all up kernel + user land). It gives you a way to reason about two different distros like
Ubuntu is Kiss plus (list of things) and for each item in the list of things, it has dependencies, recursively until you have completely described the genome of Ubuntu as a linear directed graph from Kiss. You could do the same thing for Fedora, or Mint, or any distro.
Two such graphs could give you a complete list of differences to get from distro <a> to distro <b> and the simple algorithm of walk back (remove items) from <a>, then walk down the graph (add items) to <b> would always "work" because they all share a common ancestor node, Kiss.
As a software developer you could reason about all of the changes to a distro you would need for your software to work, and this would tell you if those changes included removing something that was part of the canonical set of things in a distro, your software would not work on that distro.
Today, individual package managers do this in a distro unique way and let you work on one distro. As a software developer you end up with the "Fedora/Redhat" version, the "Ubuntu/Debian" version, maybe the "Arch/Gentoo" version.
But if the Linux community settled on a common understanding of the "genetic code" if you will, you could do that for all possible distributions. That would be a powerful thing.
This just sounds like dumb shell hate.
I personally would have used another language, but shell ain't that hard if you have some experience with it, and are using shellcheck as the author does.
The config formats of the distro are optimized for command line tools, and writing the package manager in shell seems like a good way to ensure that this is indeed the case - basic dogfooding.
Shell is great for scripting usage of other programs, far better than other programming languages. That's what it's made for, after all. It's the only thing it's made for.
I find it curious that a distro espousing simplicity would choose XOrg over Wayland (which was created to resolve problems arising from unnecessary complexity in XOrg). It looks like this is 80% simplicity and 20% sentimentality. I don't use wayland myself, but simplicity is certainly not a factor in that decision.
There are other, much more serious problems over here, of course.
It's like a lil mini haiku OS (not to be confused with HaikuOS the open BeOS).
- - - -
Ooo!
https://github.com/michaelforney/samurai
> samurai is a ninja-compatible build tool written in C99 with a focus on simplicity, speed, and portability.
I bet that during high time of UNIX wars no imagined it could get even worse.
It adds nothing to linux fragmentation.
The 'ecosystem' you are speaking of reminds me of taxes, lawyers and judges, burying their victims under infinite amounts of stamped paper in triple copies, annotated, and ultimately annoying because of its bizarreness and kafkaesque absurdity.
Time to burn it down.
(quad-edit because lack of coffeine...(spelling))
Unfortunately, the developers of many of these experimental distributions don't seem to acknowledge that they are experimental distributions ...
Turns out less is indeed less.
(Or for that matter, given the functionality presented here, I think OpenBSD as well)
* repo
* community
* kiss
Which package is the Linux kernel build stuff related? I recently wanted to bundle a quick Alpine install into a shareable `qemu` image. I couldn't figure out how to add a simple kernel module that was not included in the stock config. I would love to get this problem solved.
Hope you enabled Telemetry [2], bonus - it produces nice graphs [3].
[0] https://bugzilla.mozilla.org/show_bug.cgi?id=1345661
[1] https://github.com/kinetiknz/cubeb/wiki/Backend-Support
[2] about:telemetry
I'm curious about which use cases wasn't supported for you, why it was an uphill battle and which derivative addressed them. I don't quickly see what would give you issues at first glance.
One derivative would be https://web.obarun.org , another one https://artixlinux.org
There are lots of utilities that aren't available in wayland yet, so you'll often end up with an x server installed anyway.
Freedom is Slavery.
Less is More.
* Based on musl libc, busybox and the Linux kernel.
As some one who is working on Go ecosystem, this drops my interesting immediately. Using musl libs means a lot of tools can't be used on this OS unless we install the glibc.Busybox is not KISS. It's an all-in-one package, removing the ability to strip down the number of tools you have to the ones you strictly need. It's a big, bloated binary blob, in other words.
> Every installation of the distribution contains the full sources (of the distribution) with git history attached.
This doesn't even pretend to be minimal.