Skip to content

Instantly share code, notes, and snippets.

@voidus
voidus / Scotty_websockets.hs
Created May 25, 2019 19:12 — forked from andrevdm/Scotty_websockets.hs
Using websockets with scotty haskell
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE OverloadedStrings #-}
module Main where
import Protolude
import qualified Web.Scotty as Sc
import qualified Data.Text as Txt
import qualified Network.Wai.Middleware.Gzip as Sc
@voidus
voidus / log
Created October 27, 2022 15:06
python311Packages.cffi build failure:
> nix log /nix/store/jdh5sh79zkk626i6c9xbb8r1pz0ds0wa-python3.11-cffi-1.15.1.drv
Sourcing python-remove-tests-dir-hook
Sourcing python-catch-conflicts-hook.sh
Sourcing python-remove-bin-bytecode-hook.sh
Sourcing setuptools-build-hook
Using setuptoolsBuildPhase
Using setuptoolsShellHook
Sourcing pip-install-hook
Using pipInstallPhase
Sourcing python-imports-check-hook.sh
{
description = "A basic nixos cloudinit image";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs";
};
outputs = { self, nixpkgs }:
let
system = "x86_64-linux";
@voidus
voidus / flake.nix
Created April 22, 2023 18:35
Build a cloudinit image in nixos
{
description = "A nixos cloudinit base image without nixos-infect";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs";
};
outputs = { self, nixpkgs }:
let
system = "x86_64-linux";
@voidus
voidus / overlay.nix
Created April 23, 2023 16:17
patching go dependencies in nix is hard
(final: prev: {
gh = prev.gh.overrideDerivation (old: {
buildPhase =
let
patch =
(final.fetchpatch2 {
url = "https://github.com/zalando/go-keyring/commit/4e8623abca7e227443bc7e95dd1c0bdfc1490545.patch";
sha256 = "sha256-TWaLoA9BpEzXYdguXjMxuQB9e3+QMKMTkxhJTSQeWJs=";
extraPrefix = "vendor/github.com/zalando/go-keyring/";
stripLen = 1;
@nix { "action": "setPhase", "phase": "unpackPhase" }
Running phase: unpackPhase
unpacking source archive /nix/store/3d4rwkakp20rx15dd8fxmdgyzcwjgrfg-ghc-9.8.1-src.tar.xz
source root is ghc-9.8.1
setting SOURCE_DATE_EPOCH to timestamp 1696647801 of file ghc-9.8.1/utils/genprimopcode/Lexer.hs
@nix { "action": "setPhase", "phase": "patchPhase" }
Running phase: patchPhase
applying patch /nix/store/32kfndxy8dbaa47jbpg2fp4lsd4wcxmg-docs-sphinx-7-ghc98.patch
patching file docs/users_guide/rtd-theme/layout.html
patching script interpreter paths in .
@nix { "action": "setPhase", "phase": "unpackPhase" }
Running phase: unpackPhase
unpacking source archive /nix/store/3d4rwkakp20rx15dd8fxmdgyzcwjgrfg-ghc-9.8.1-src.tar.xz
source root is ghc-9.8.1
setting SOURCE_DATE_EPOCH to timestamp 1696647801 of file ghc-9.8.1/utils/genprimopcode/Lexer.hs
@nix { "action": "setPhase", "phase": "patchPhase" }
Running phase: patchPhase
applying patch /nix/store/32kfndxy8dbaa47jbpg2fp4lsd4wcxmg-docs-sphinx-7-ghc98.patch
patching file docs/users_guide/rtd-theme/layout.html
patching script interpreter paths in .
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by The Glorious Glasgow Haskell Compilation System configure 9.8.1, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ ./configure --prefix=/nix/store/q7nr806bffrgx5pl0k742qa2lnkjqfmz-javascript-unknown-ghcjs-ghc-native-bignum-9.8.1 --bindir=/nix/store/q7nr806bffrgx5pl0k742qa2lnkjqfmz-javascript-unknown-ghcjs-ghc-native-bignum-9.8.1/bin --sbindir=/nix/store/q7nr806bffrgx5pl0k742qa2lnkjqfmz-javascript-unknown-ghcjs-ghc-native-bignum-9.8.1/sbin --includedir=/nix/store/q7nr806bffrgx5pl0k742qa2lnkjqfmz-javascript-unknown-ghcjs-ghc-native-bignum-9.8.1/include --oldincludedir=/nix/store/q7nr806bffrgx5pl0k742qa2lnkjqfmz-javascript-unknown-ghcjs-ghc-native-bignum-9.8.1/include --mandir=/nix/store/q7nr806bffrgx5pl0k742qa2lnkjqfmz-javascript-unknown-ghcjs-ghc-native-bignum-9.8.1/share/man --infodir=/nix/store/q7nr806bffrgx5pl0k742qa2lnkjqfmz-javascript-un
@voidus
voidus / conftest.py
Created September 17, 2024 22:43
The pytest factoryboy integration we need
from typing import assert_never
from uuid import uuid4
from factory import random as factory_random
from pytest import (
CallInfo,
Item,
StashKey,
hookimpl,
)