Skip to content

Instantly share code, notes, and snippets.

{
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11";
outputs = { nixpkgs, ... }:
let
system = "x86_64-linux";
pkgs = import nixpkgs { inherit system; };
in {
packages.${system}.default = pkgs.stdenv.mkDerivation {
name = "dotfiles";
src = builtins.fetchGit {
@myme
myme / flake.nix
Created September 18, 2022 21:46
Terraform Flake
{
description = "Terraform 1.1.9 package + shell flake";
inputs.nixpkgs.url = "nixpkgs/nixos-22.05";
outputs = { self, nixpkgs }:
let
system = "x86_64-linux";
pkgs = import nixpkgs { inherit system; };
terraform = pkgs.mkTerraform {
@myme
myme / audio.js
Last active December 29, 2020 19:15
Testing out Web Audio API with a simple morse code generator.
(function () {
"use strict";
var audioCtx = new (window.AudioContext || window.webkitAudioContext)();
var morseAlphabet = {
a: '.-',
b: '-...',
c: '-.-.',
@myme
myme / foo.hs
Last active December 25, 2019 21:54
import Data.Char (ord)
import Data.Conduit ((.|))
import qualified Data.Conduit as C
import qualified Data.Conduit.Combinators as C
import qualified Data.ByteString.Char8 as B
main = C.runConduit
$ C.stdin
.| C.concatMap B.words
.| C.concatMap transform
{ config, pkgs, ... }:
let
koi = import <koi> {};
unstable = import <unstable> {};
in {
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
@myme
myme / debug.log
Last active September 28, 2019 11:04
Hiri on NixOS
~/tmp/hiri 17s
❯ nix-build hiri-fhs.nix && ./result/bin/hiri
/nix/store/7frna9nf8ak0p9ra8g909w5j0m4jyd15-hiri
Traceback (most recent call last):
File "site-packages/PyInstaller/loader/pyiboot01_bootstrap.py", line 149, in __init__
File "ctypes/__init__.py", line 347, in __init__
OSError: /usr/lib/libgobject-2.0.so.0: undefined symbol: g_date_time_unref
During handling of the above exception, another exception occurred:
@myme
myme / shell.nix
Created April 10, 2019 19:05
Python/JavaScript dev env
{ pkgs ? import <nixpkgs> {} }:
let
# yarn > 1.10.x
unstable = import (fetchTarball {
url = "https://releases.nixos.org/nixos/19.03/nixos-19.03.172138.5c52b25283a/nixexprs.tar.xz";
sha256 = "14289382e88abeb2a049e948c301818a034bf09d306ce127d765a87ba644d205";
}) {};
app = pkgs.buildFHSUserEnv {
name = "app";
targetPkgs = pkgs: (with pkgs; [
module App.Diff.Entry where
import Prelude
import Data.Either (either)
import Data.Function.Uncurried (Fn2, mkFn2)
import Data.Maybe (Maybe(..))
import Data.Pair (fst, (~))
import Foreign (Foreign)
import App.Diff.Class (Diff, recordDiff)
@myme
myme / output-ioref.txt
Last active October 23, 2018 20:42
How to get output up until failure?
❯ stack turtle.hs
"foo"
"bar"
"Failed!"
@myme
myme / API.purs
Created August 31, 2018 11:18
Failed pattern match
module Krank.API where
import Prelude
import Control.Monad.Error.Class (throwError)
import Data.Either (either)
import Effect.Aff (Aff)
import Effect.Class (liftEffect)
import Effect.Console as C
import Effect.Exception (error)