This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -euo pipefail | |
gh_ () { | |
## Dry-run mode | |
echo "gh $@" | |
## Real mode | |
# gh "$@" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let lib = { | |
handle_record_field = fun rec_name { fields, type, contracts, documentation } => | |
m%" | |
<details> | |
<summary>%{rec_name}</summary> | |
<div style="margin-left:12px"> | |
%{if documentation != null then documentation else "_no documentation_"} | |
%{if type != null then "- *type*: %{type}" else ""} | |
%{if contracts != [] then "- *contracts*:\n%{ | |
contracts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# A library for NixOS-style “modules” | |
# | |
# Modules are records whose contract gets extended through merging: `Module c` | |
# is a contract semantically equivalent to `c`, except that if `foo` has | |
# contract `Module x` and `bar` has contract `Module y`, then `foo & bar` will | |
# have contract `Module (x&y)`. | |
{ | |
empty = { contract.contract | optional }, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let p = import <nixpkgs> {}; in | |
let | |
discardReferences = path: | |
let | |
# We want to use a different nixpkgs here to make sure that the `noref` | |
# version won't accidentally share some build-time references with the | |
# original one | |
p2 = (builtins.getFlake "github:nixos/nixpkgs/nixos-unstable").legacyPackages.${builtins.currentSystem}; | |
mangledPath = p2.runCommandNoCC "${path.name}.tar.gz" {} '' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
inputs.nixpkgs.url = "github:nixos/nixpkgs/a7cc81913bb3cd1ef05ed0ece048b773e1839e51"; | |
outputs = { self, nixpkgs }: { | |
testPathExists = | |
let hello = nixpkgs.legacyPackages.x86_64-linux.hello; in | |
builtins.pathExists hello; | |
testPathExists2 = | |
# Output of `nix eval --inputs-from . nixpkgs\#hello.outPath` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"nodes": { | |
"flake-utils": { | |
"locked": { | |
"lastModified": 1644229661, | |
"narHash": "sha256-1YdnJAsNy69bpcjuoKdOYQX0YxZBiCYZo4Twxerqv7k=", | |
"owner": "numtide", | |
"repo": "flake-utils", | |
"rev": "3cecb5b042f7f209c56ffd8371b2711a290ec797", | |
"type": "github" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -euo pipefail | |
set -x | |
rm -rf A B | |
mkdir -p A B | |
pushd A | |
echo foo > foo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
"criterion", | |
"1.4.1.0", | |
[ | |
{ | |
"reportAnalysis": { | |
"anMean": { | |
"estError": { | |
"confIntLDX": 0.00020337399737880256, | |
"confIntUDX": 0.0005146031421548181, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ stdenv, ocaml, ocamlPackages, makeWrapper }: | |
stdenv.mkDerivation rec { | |
name = "ocaml_with_topfind-${version}"; | |
version = lib.getVersion ocaml; | |
nativeBuildInputs = [ makeWrapper ]; | |
buildCommand = '' | |
makeWrapper "${ocaml}/bin/ocaml" "$out/bin/ocaml_topfind" \ | |
--add-flags "-I ${ocamlPackages.findlib}/lib/ocaml/${version}/site-lib" | |
''; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This diff is a modified version of a diff written by Arnis Lapsa. | |
[ The original can be found here: https://gist.github.com/ArnisL/6156593 ] | |
This diff adds support to tmux for 24-bit color CSI SRG sequences. This | |
allows terminal based programs that take advantage of it (e.g., vim or | |
emacs with https://gist.github.com/choppsv1/73d51cedd3e8ec72e1c1 patch) | |
to display 16 million colors while running in tmux. | |
The primary change I made was to support ":" as a delimeter as well |