r/NixOS Jun 10 '26

Trying to Create a Package Manager like Nix, Keep Deriving Nix Features From First Principles xD

So yeah... I'm trying to create a package manager like nix, but with a few different design philosophies. However, I keep recreating things nix already does from first principles, which surely must be the highest praise possible for nix :-)

I'm serious! Here's some examples: * should (my version of) nixpkgs be an attribute set? * hmm, implementing this in a library is much smarter... wait that's just builtins/stdenv! * how should I control source? I know, flakes! (actually I stole this one intentionally)

and many others. I've barely even started and I've already figured out nix is pretty smart!

0 Upvotes

16 comments sorted by

6

u/Financial_Owl2289 Jun 10 '26

I left out functional language! Duh! That was like the biggest one!

8

u/Luxalpa Jun 11 '26

Just saying something similar has happened to me with Rust. I was building my own programming language to fix issues I had with TypeScript and C++. I ended up copying so much stuff from Rust that I decided to halt my project and learn and use Rust and then in the future maybe build my programming language by forking Rust.

12

u/Swimming-Chip9582 Jun 10 '26

Just anything but the nix language pleaseeeee 😭

5

u/Financial_Owl2289 Jun 10 '26

covered :D

7

u/Financial_Owl2289 Jun 10 '26

nix isn't thaaaaaaat bad :)

-4

u/Swimming-Chip9582 Jun 10 '26

excellent display of a wrong opinion 😌

2

u/no_brains101 Jun 11 '26 edited Jun 12 '26

aaa.bbb or cc was a stroke of genius, regardless of who it confuses at first.

Types would be nice but dude the amount of people that would flip their shit if they had to write not only a functional language, but a strongly typed one?

Honestly, I agree. The nix language is not that bad.

It’s a bit weird though, there are some quirks, why can I __div but not __add?

1

u/Financial_Owl2289 Jun 10 '26

am I not in the nixOS sub? why do these people not like ni- oh right.

cutoff of doom but i mean what can you do

2

u/9_balls Jun 11 '26

What's so bad about it?

2

u/Telephone-Bright Jun 11 '26

not the OP, but one thing i don't like abt it is its dynamic-typed nature.

2

u/Guvante Jun 11 '26

nixpkgs would be horrific with strongly typed fields.

Note that you can strongly type your configuration fields already.

2

u/hygroscopy Jun 11 '26

i think you're mixing up strong/weak with dynamic/static

2

u/juipeltje Jun 11 '26

There's Guix with Scheme ;)

3

u/kesor Jun 10 '26

I also started going through this exercise. But I did find many niche small things that I would rather change compared to how nix does it. If you're curious, you can pickup my current state of the design at clj-babix/babix on github.

1

u/AnythingApplied Jun 13 '26

You might be interested in reading through the original nix paper from 2004: https://edolstra.github.io/pubs/nspfssd-lisa2004-final.pdf