Skip to content

Instantly share code, notes, and snippets.

View patrl's full-sized avatar

Patrick Elliott patrl

View GitHub Profile
@patrl
patrl / 40_custom
Created October 3, 2016 14:38
Custom menu entries for grub2 for btrfs subvolumes. This file lives in /etc/grub.d/.
#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
menuentry "NixOS" {
set root=(hd0,gpt3)
configfile '/@nixos/boot/grub/grub.cfg'
}

Keybase proof

I hereby claim:

  • I am patrl on github.
  • I am patrl (https://keybase.io/patrl) on keybase.
  • I have a public key ASDOGewU9ogOAUQzTXIqQnWj40zZ4xawNSU1TUu2m7U9vgo

To claim this, I am signing this object:

@patrl
patrl / wireguard.nix
Created November 28, 2017 11:07
NixOS wireguard configuration
{config, pkgs, ... }:
{
networking.wireguard.interfaces = {
wg0 = {
ips = [ $ADDR1 ];
peers = [ {
allowedIPs = [ $ADDR2 ];
endpoint = $ADDR3;
publicKey = $KEY1;
@patrl
patrl / pdfMerge
Created January 23, 2018 12:57
Script for mergings pdfs using ghostscript. Fetches dependencies using nix.
#! /usr/bin/env nix-shell
#! nix-shell -i bash -p bash ghostscript
for ARG in "$@"
do
gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=out.pdf $ARG
done
@patrl
patrl / Junct.hs
Created April 26, 2018 10:38
Mitrovic & Sauerland's (2014) J head as a monoidal binary operation
module Juncts where
import Data.Function
-- the model
type T = Bool
data Ent = Tom | Dick | Harry deriving (Eq, Show)
(setq user-mail-address "patrick.d.elliott@gmail.com"
user-full-name "Patrick Elliott")
(doom! :feature
;debugger ; FIXME stepping through code, to help you add bugs
eval ; run code, run (also, repls)
(evil +everywhere); come to the dark side, we have cookies
file-templates ; auto-snippets for empty files
;(lookup ; helps you navigate your code and documentation
;+devdocs ; ...on devdocs.io online
;;; config.el -*- lexical-binding: t; -*-
(setq user-mail-address "patrick.d.elliott@gmail.com"
user-full-name "Patrick Elliott")
;; disables immediate spellchecking in a latex buffer
(setq-hook! 'LaTeX-mode-hook +spellcheck-immediately nil)
(set! :latex-bibtex-file "/home/patrl/GitHub/bibliography/elliott_mybib.bib")
(set! :latex-bibtex-pdfs-dir "/home/patrl/Dropbox/Library")
@patrl
patrl / scuttlebotNix.org
Last active July 17, 2018 12:04
Building scuttlebot on NixOS

Building scuttlebot on NixOS

  • Clone the scuttlebot source from GitHub.
  • cd into the source directory and run node2nix.
  • Create a new file in the source directory override.nix with the following contents:
    {pkgs ? import <nixpkgs> { inherit system; }, system ? builtins.currentSystem}:
        
@patrl
patrl / shell.nix
Last active September 10, 2018 20:17
A nix environment for developing with dwarf-term-rs: https://github.com/Lokathor/dwarf-term-rs
# Latest Nightly
with import <nixos> {};
let src = fetchFromGitHub {
owner = "mozilla";
repo = "nixpkgs-mozilla";
rev = "136eacc0ceefa8fb44677799e5639e083606ee5d";
sha256 = "04bz093x3zjkzp7ba8mh876a1a34kp3jrys87m79gbln5qvcd2ir";
# date = 2018-09-06T17:09:51+02:00;
};
in
with import <nixpkgs> {};
let src = fetchFromGitHub {
owner = "mozilla";
repo = "nixpkgs-mozilla";
# commit from: 2018-03-27
rev = "136eacc0ceefa8fb44677799e5639e083606ee5d";
sha256 = "04bz093x3zjkzp7ba8mh876a1a34kp3jrys87m79gbln5qvcd2ir";
# date = 2018-09-06T17:09:51+02:00;
};
myrust = (latest.rustChannels.stable.rust.override { extensions = [ "rust-src" ]; });