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 / 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)
@myme
myme / *Backtrace*
Created August 11, 2018 09:19
swiper-helm backtrace
Debugger entered--Lisp error: (error "No such live buffer *swiper*")
signal(error ("No such live buffer *swiper*"))
error("No such live buffer %s" "*swiper*")
window-normalize-buffer("*swiper*")
replace-buffer-in-windows("*swiper*")
helm-cleanup()
#f(compiled-function () #<bytecode 0x12b0ba5>)()
helm-internal(((name . "README.org") (init lambda nil (add-hook 'helm-move-selection-after-hook (function swiper--update-sel)) (add-hook 'helm-update-hook (function swiper--update-input-helm)) (add-hook 'helm-after-update-hook (function swiper--reanchor))) (match-strict lambda (x) (ignore-errors (string-match (ivy--regex helm-input) x))) (candidates #("1 * Dotfiles" 3 4 (wrap-prefix #("* " 0 2 (face org-indent)) line-prefix "" face org-level-1 help-echo "mouse-2: visibility cycling for Org mode" mouse-face highlight keymap ((mouse-1 . org-cycle) (mouse-2 lambda (e) (interactive "e") (mouse-set-point e) (org-cycle))) composition (0 1 [9673]) fontified t) 4 5 (wrap-prefix #("* " 0 2 (face org-indent)) lin