Skip to content

Instantly share code, notes, and snippets.

View philiptaron's full-sized avatar

Philip Taron philiptaron

View GitHub Profile
@philiptaron
philiptaron / flake.nix
Created February 21, 2025 21:38
multiple-outputs-huhhhh.nix
{
description = "What's the deal with multiple outputs?";
inputs.nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
outputs = { self, nixpkgs }: {
packages.x86_64-linux.default = nixpkgs.legacyPackages.x86_64-linux.stdenvNoCC.mkDerivation {
name = "test";
outputs = [ "bin" "out" ];
dontUnpack = true;
#!/usr/bin/env bash
set -e
NIX_ID_RE="[a-zA-Z_][0-9A-Za-z_'-]*"
LIB_RE="$(sed -z 's/\n/|/g; s/|$/)/; s/^/(/' /tmp/names/lib)"
doWork() {
f=$1

Here are there set of names exported from lib/default.nix. These are usually accessed from the injected lib parameter.

This list was produced by running nix eval --json --apply builtins.attrNames nixpkgs#lib | jq -r '.[]'.

__unfix__
add
addContextFrom
addErrorContext
addMetaAttrs
import heapq
class Graph(object):
'''
A directed, weighted graph.
'''
def __init__(self, edges=None):
'''
Initializes a graph.