Skip to content

Instantly share code, notes, and snippets.

@kalbasit
Created January 8, 2019 16:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kalbasit/cbd0a6eddfe3b1ee5b90662f1b5e98c1 to your computer and use it in GitHub Desktop.
Save kalbasit/cbd0a6eddfe3b1ee5b90662f1b5e98c1 to your computer and use it in GitHub Desktop.
λ  nix repl
Welcome to Nix version 2.1.3. Type :? for help.
nix-repl> pkgs = import <nixpkgs> {}
nix-repl> transform = with pkgs; with pkgs.lib; let transformType = with types; let list3 = elemType: addCheck (listOf elemType) (l: length l != 3); in uniq (list3 (list3 float)); in mkOption { type = transformType; description = "3×3 matrix of floating point numbers"; default = []; example = [ [ 0.6 0.0 0.0 ] [ 0.0 0.6 0.0 ] [ 0.0 0.0 1.0 ] ]; }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment