Get the latest tech news

RNG and Cosine in Nix


How to implement random number generation and cosine for your NixOS configuration

NixOS is an immutable, atomic Linux distribution with a declarative and reproducible configuration and packaging system using the purely functional, lazily evaluated, dynamically typed Nix programming language. Sadly, Nix doesn’t have built-in RNG since it’s purely functional, but I found a project called rand-nix with this code: Kublai: Welp I kinda forgot what I wanted to use cosine for in my configuration.nix in the first place… If you’d like to read some slightly less cursed Nix stuff, here are some great articles.

Get the Android app

Or read this on Hacker News

Read more on:

Photo of RNG

RNG

Photo of nix

nix

Photo of Cosine

Cosine

Related news:

News photo

Improved evaluation times with pre-resolved Nix store paths

News photo

Persistent packages on Steam Deck using Nix

News photo

Nix – Death by a Thousand Cuts