Code Snippets Nix

Short texts Nix 🧑‍💻 Code snippets Nix ✍️ Reading lists Nix 👀

Nix direnv template

use flake { description = “A very basic flake”; inputs = { nixpkgs.url = github:NixOS/nixpkgs; flake-utils.url = github:numtide/flake-utils; }; outputs = { self, nixpkgs, flake-utils }: flake-utils.lib.eachDefaultSystem (system: let pkgs = nixpkgs.legacyPackages.${system}; in { devShell = pkgs.mkShell { name = “template-shell”; buildInputs = with pkgs; [ alsa-lib udev ]; nativeBuildInputs = with pkgs; [ pkg-config […]

bcachefs support (needs fixing)

{ config, lib, pkgs, … }: with lib; let kernel = { date = “2021-10-01”; commit = “4114ced1db46”; hash = “05rnr7d704cq60k4yfw070ph9z6zjkrl68c07rca9cwx6km34zqf”; version = “5.13”; }; tools = { date = “2021-06-23”; commit = “3f7b0b0832a61ccaf590f3503521eb7cf8f14f64”; hash = “06a81dhnm3qfwin6rh4nryyrz4yhaqbcmac9s4jdcyg5707lp49w”; }; nixkernel = “linux_5_14”; in { disabledModules = [ “tasks/filesystems/zfs.nix” ]; nixpkgs.overlays = [ (self: oldpkgs: { linux_testing_bcachefs […]

simple C-make example.

{ lib, stdenv, pkg-config, libsndfile, fftw, zita-convolver, ladspaH, ffmpeg, alsaLib, libao, libmad, libpulseaudio, libtool }: let pkgs = import {}; in stdenv.mkDerivation rec { pname = “bmc0-dsp”; version = “1.8”; src = pkgs.fetchFromGitHub { owner = “bmc0”; repo = “dsp”; rev = “6f1936b28433dc8e588f6a2ecac24dfc61af0a2c”; sha256 = “0hf483kwj65z3vbkfn7gvlalmfx2ync70kayy85pm2q662kj6f1d”; }; nativeBuildInputs = [ pkg-config ]; buildInputs = [ […]

simple C-make example.

{ lib, stdenv, pkg-config, libsndfile, fftw, zita-convolver, ladspaH, ffmpeg, alsaLib, libao, libmad, libpulseaudio, libtool }: let pkgs = import {}; in stdenv.mkDerivation rec { pname = “bmc0-dsp”; version = “1.8”; src = pkgs.fetchFromGitHub { owner = “bmc0”; repo = “dsp”; rev = “6f1936b28433dc8e588f6a2ecac24dfc61af0a2c”; sha256 = “0hf483kwj65z3vbkfn7gvlalmfx2ync70kayy85pm2q662kj6f1d”; }; nativeBuildInputs = [ pkg-config ]; buildInputs = [ […]

simple C-make example.

{ lib, stdenv, pkg-config, libsndfile, fftw, zita-convolver, ladspaH, ffmpeg, alsaLib, libao, libmad, libpulseaudio, libtool }: let pkgs = import {}; in stdenv.mkDerivation rec { pname = “bmc0-dsp”; version = “1.8”; src = pkgs.fetchFromGitHub { owner = “bmc0”; repo = “dsp”; rev = “6f1936b28433dc8e588f6a2ecac24dfc61af0a2c”; sha256 = “0hf483kwj65z3vbkfn7gvlalmfx2ync70kayy85pm2q662kj6f1d”; }; nativeBuildInputs = [ pkg-config ]; buildInputs = [ […]