Skip to content

Instantly share code, notes, and snippets.

View taktoa's full-sized avatar
🤔
Confused about why this feature exists

Remy Goldschmidt taktoa

🤔
Confused about why this feature exists
View GitHub Profile
@taktoa
taktoa / incremental.nix
Last active January 8, 2018 12:57
Build the profunctors library incrementally using Nix.
with builtins;
rec {
pkgs = import <nixpkgs> {};
testGHC = pkgs.haskellPackages.ghcWithPackages (p: with p; [
base base-orphans bifunctors comonad contravariant distributive
tagged transformers
]);
@taktoa
taktoa / bootstrap.nix
Last active November 8, 2017 22:52
Portably bootstrap nixpkgs without fetchTarball nonsense
{ system ? builtins.currentSystem }:
# In order to update `nixpkgs.json` to a specific revision, run:
#
# ```bash
# $ nix-prefetch-git https://github.com/NixOS/nixpkgs.git "${REVISION}" > nixpkgs.json
# ```
with rec {
builtin-paths = import <nix/config.nix>;
@taktoa
taktoa / Badges.hs
Created September 22, 2017 09:13
Hydra badge server, written in Haskell
{-# LANGUAGE ExistentialQuantification #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE PackageImports #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeApplications #-}
module Main where
import Numeric (showHex)
@taktoa
taktoa / mrkgnaow-xmonad.nix
Created September 25, 2017 15:30
Example of using `callCabal2nix` to set up xmonad with a cabalized configuration
{ pkgs }:
{
services.windowManager.xmonad = {
enable = true;
haskellPackages = pkgs.haskellPackages.override {
overrides = self: super: {
# /path/to/mrkgnaow-xmonad is a path that contains `mrkgnaow-xmonad.cabal`
# you can also put an invocation of `fetchgit` or `fetchFromGitHub` there.
mrkgnaow-xmonad = self.callCabal2nix "mrkgnaow-xmonad" /path/to/mrkgnaow-xmonad {};
@taktoa
taktoa / collapse.tex
Created November 10, 2017 16:51
Collapseable text box in LaTeX using OCG
% in the preamble:
\usepackage{ocgx}
% in the document:
\switchocg{ocgPlus ocgMinus ocg1}{%
\begin{ocg}{plus}{ocgPlus}{1}
{\bfseries +}
\end{ocg}
@taktoa
taktoa / .hlint.yaml
Created November 19, 2017 04:07
My HLint YAML file
- extensions:
- default: true
# These are basically non-negotiable
- {name: AllowAmbiguousTypes, within: []} # should never be necessary
- {name: Arrows, within: []} # weird syntax
- {name: DatatypeContexts, within: []} # useless
- {name: EmptyCase, within: []} # nearly useless
- {name: ImpredicativeTypes, within: []} # very buggy
- {name: IncoherentInstances, within: []} # footgun
@taktoa
taktoa / keybase.nix
Created November 22, 2017 20:21
Getting the Keybase GUI to work on NixOS
# Add this file to your /etc/nixos/configuration.nix `imports = [ ... ];` attribute.
#
# After running `nixos-rebuild switch`, `systemctl --user start keybase-gui.service`
# can be used to start the Keybase GUI.
#
# Not sure if it's just my tiling window manager, but there is a bit of wonkiness
# with the tray icon. Other than that it works perfectly (as of 2017/11/22).
{ pkgs, ... }:
@taktoa
taktoa / KindOfGenerativeModuleFunctors.agda
Created November 27, 2017 17:21
A quasi-successful attempt at hacking generative module functors into Agda 2.5.3
module KindOfGenerativeModuleFunctors where
------------------------------------------------------------------------------
open import Data.Product using (_×_; _,_)
open import Data.Nat using (ℕ)
open import Data.Bool using (Bool; false; true)
open import Relation.Binary.PropositionalEquality using (_≡_; _≢_; refl)
------------------------------------------------------------------------------
--------------------------------------------------------------------------------
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE KindSignatures #-}