Hacker News new | past | comments | ask | show | jobs | submit login
Kākāpō – A web bundler for Nix strings with context (github.com/adisbladis)
96 points by todsacerdoti 10 months ago | hide | past | favorite | 41 comments



I would be completely happy with Nix as a universal build and deploy language.


It is amazing what the Nix team has built. It's horribly complex, especially once you start peering behind the nixpkgs curtain, and yet it works incredibly well and is almost universally adaptable.

I've got my 2 personal machines as well as my homelab and a few other appliances all running off of it now.


The ideas of Nix are very powerful, but the experience of using it can be frustrating. It desperately needs a UX overhaul, or at the very least a distro that wraps it into a user-friendly package.

I would happily adopt it as a build and deploy system if the UX was improved, but I currently hesitate to recommend it to my teammates because of its rough edges and steep learning curve.


There's been several UX improvements merged lately. For instance, better error messages upon runtime type errors iirc.

As is, Nix isn't actually hard if people learn how to learn. I see coworkers have trouble with it but don't even know how to use the repl to debug. I always debug their issues in an instant.

So docs and education would be my focus.


I've used it over a year and haven't had to use the repl. What are examples of problems you've found the repl to be useful for solving?


Me, too, more or less. I think there's room for improvement, but Nix is a nice language for that niche.


You maybe interested in a project I've been working on (nix-server-tools): https://github.com/kish10/nix-server-tools.

The goal is to create tools using Nix to make it easy to deploy applications on a server.

----

So far the project can:

- Create docker-compose files that: deploy a `Caddy` server & server applications in a reverse proxy through the Docker bridge network.

---- This way Caddy & Let's Encrypt takes care of TSL certificates, while thanks to Nix & Docker we simply need to create docker-compose files. (for an easy deployment)

- Deploy a `paperless-ngx` application that backups files using `borgbackup` & sends an error email when the backup fails.

----

Next week I plan to add:

- A Nix generated `cloud-init.yaml` file to make it easy to initialize & setup new servers (for easy & quick deployment of applications that need to run on additional servers).

----

Examples:

- Deploying a "hello-test-app": https://github.com/kish10/nix-server-tools/blob/main/reverse...

- Deploying a "hello-test-app" & "paperless-ngx -- with borgbackup & error emails": https://github.com/kish10/nix-server-tools/blob/main/reverse...

----

I just started open sourcing the code this week, so there isn't a lot of documentation & examples.

I could definitely use feedback & contributions, so I'd appreciate it if you would take a look.


This is pretty neat. I wonder if the idea could be extended more generally to "un-nixify" packages - i.e. replace references to the nix store with relative paths.

I can envision some applications for distributing packages for non-nix systems while still relying on nix to build them.



Not really. Guix only really targets Linux and it achieves relocatable packs by virtualizing the filesystem in a variety of extremely non-portable ways. You can do this with Nix as well, of course, Guix wins no points here.

Neither supports non-absolute paths which is the crux of the issue.


This can (and has) been done but sooner or later you step on a landmine package for which this is not possible (reliably patching the output), so you end up rebuilding (reliably patching the input) and now you're inevitably rebuilding the entire world. It would've been easier to just do that in the first place.

That being said I've long suspected there is a happy middle ground where you hack at the problem from both sides. On one side you provide F(x) -> x' where x is an absolute path closure and x' is a relative path closure, for any supported subgraphs in the build graph. Then, for the rest, you rebuild from source using any transformed inputs you can. In other words, when you're evaluating x', if you have x in a cache already, and you can rewrite it, do so. If not, just build it from scratch.

The problem is at some point you have to prove that both methods of producing x' result in the same exact output. This is not easy! However you can possibly prove it for any arbitrary closure by simply round tripping. For example, assuming the transform F(x) -> x' is cheap, and at some point you build x, which is almost guaranteed, then allow x'' == x and when you build x just try and retarget it anywhere, and then back again.

This doesn't prove it actually works, but might prove that it's correct, which is acceptable to me. I haven't got far enough to try this out yet, of course. Be my guest!


There's an older attempt at a universal Nix bundler here: https://github.com/matthewbauer/nix-bundle

The flake schema has a "bundler" output that can point to an executable like this to bundle a flake's outputs for any supported target. Not sure about the state of the art, though.


My main gripe with this (and guix mentioned in a sibling comment) is lack of macOS support. I believe macOS support is a large part of why Nix is able to become so popular.


There's this, which does work on macOS

https://github.com/3noch/nix-bundle-exe

I've never tried it out though.


Kakapo is also Maori for a very cute little flightless parrot native to the New Zealand islands.


Known is the emoji world as party parrot. The bird's name is Sirocco. https://www.doc.govt.nz/sirocco


Oh wow, I'm not meme-hip and had no idea that came from a parrot mating with the back of a guy's head.

Work will never be same (developers on my team love to use it in slack reactions)


Douglas Adams is mostly known for his Sci-Fi books, but he also wrote a book about endangered species in the late 80's/early 90's that he said was his favorite work. One of those he visited was the Kakapo, and his infatuation with the bird was clear from his writing. Certainly he got me to like them as well.


I’m a big Adam’s fan and Last Chance to See is my favorite book of his. It’s the first thing I thought of when I saw the title.

If you’re interested, try the audiobook. It’s narrated by Adam’s himself.


If you mean Kākāpō - yes it is!

I saw this is already a Github issue for this project - but use of a Māori bird name is considered tapu (holy or sacred) to Māori.

Hopefully that doesn't distract from the project, the developer should probably consider the implications of choosing such a name (it may look like cultural appropriation).

Kia ora!


The author/developer lives in New Zealand. I don't see how it's 'cultural appropriation', to any extent that naming a programming project after a bird can even be cultural appropriation.


Conversations about NZ cultural specifics always turn to bull paki on HN. There is not enough people who understand the philosophical and historical underpinnings of why NZ should be a partnership and why Māori worldview should be respected. And there are just too many unreflective people who see white culture as the default.


That's really odd framing to me -- you seemingly think that I have to justify what I think or say through the Māori lens or worldview, as if it were some kind of default. I don't. You could say that a country is a partnership between the people who live in it, New Zealand is a democracy after all. But I, the person writing this comment, is not an entity in partnership with the Māori people or worldview. I don't follow their traditions or customs, but you're free to.


As a Kiwi I remember all sorts of shenanigans like the crater of Mt. Eden being considered Tapu and not to be tread upon but that didn't seem to stop all the cuzzies from going down there and drinking boxes of Cody's and leaving the cans everywhere.

Or not seeing many Maori in language classes cause they weren't interested but I was required to attend (opt out, but I wanted to learn a bit of Maori).

Respect is earned and I think active and friendly participation in their own culture would help foster the partnership you talk about. But growing up most of what I saw was selective participation.


This sums it up better than I can: https://taiuru.co.nz/branding/#Consultation

| If using a Māori cultural element, it is essential that you create a cultural narrative around your brand or product including the usage, your thinking and where you gained inspiration from. In Māori culture this is called ‘whakapapa’. Everything in the Māori world has whakapapa. It is also your first line of defense if someone accuses you of cultural appropriation.


That article confirms there is no crime being committed by using the name without consent (as no consent is legally needed under current NZ law).

They blame an outdated copyright system.

Given how long treat claims have been going on for, I’ve little sympathy for such perspectives. Get it in law, or leave it be. Don’t try guilt trip others over concepts that don’t exist outside Maoridom - like mana.

Seriously its threads like this that do nothing but reinforce negative connotations of Maori. It would have been better to race relations to not mention it.


The first line of defense if somebody accuses the author of cultural appropriation is to simply reply that it is his own culture. It's odd to presume that he has any special requirement to justify his use of a word that he, as a New Zealander, has as much right to as anybody else.


Te Reo is often considered a taonga due to its value in the heritage and identity of the Māori people of New Zealand.

Te Reo names are often gifted by Iwis or individuals with sufficient Mana. As a Tangata Whenua Inia, I was strongly recommended to avoid using Te Reo names in business due to cultural reasons.


I'm from New Zealand myself, I understand the cultural context here. I grew up using the word Kākāpō as the common word for referring to the actual bird. If I was the author, and somebody takes offense from my usage of the word Kākāpō (the word used in English as well as Māori), I would politely ignore their concern. Mana, just as in World of Warcraft as in real life, is of little concern to me.


Taonga are shared, for everyone imo.

And getting precious over a word is ridiculous, it seemed to be a common theme growing up in NZ, there's a general apathy until there's some perceived benefit and then suddenly it's about race and culture.


The developer might be Maori. In which case, that's very cool indeed.


Even if the developer isn't, it's no problem at all. The word is to be used and enjoyed by all New Zealanders, and anybody else for that matter.


they would be well placed to explain their whakapapa and reasons for choosing the name, nē?


We use Maori bird names for all sorts of things in NZ, such as my child's kindergarten room. Is there a difference between that and this? Or do you think neither is okay?


Have they tried asking the bird?


The bird's smart enough not to talk. Otherwise it'd be in even deeper trouble, they are a rarity these days.


seems to be in good taste, now if it was to be a name for malware perhaps the playful Kea would be better.

Upvoted for the name, from Kiwiland myself :)


Has someone german-speaking looked over the name before it got selected?


It means "poopy butt" in german. I giggle every time I hear about the Kakapo bird.


The vowels are different. So, although they look the same, the words wouldn't sound the same.


Given the bird's character – I think it would appreciate this!




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: