Skip to content

Instantly share code, notes, and snippets.

@mkohler
mkohler / nix-github-url
Created June 24, 2022 21:07
Create a github archive link for the current version of nixpkgs
#!/bin/sh
# Get the current version, and then use tr to remove double-quotes.
version=$(nix-instantiate --eval --attr 'lib.version' '<nixpkgs>' | tr -d '"')
# The version is in the form YY.MM.NUM.HASH. We just want the 4th field.
commit_hash=$(echo ${version} | cut -d '.' -f4)
echo "https://github.com/NixOS/nixpkgs/archive/${commit_hash}.tar.gz"

Installing on Linode

I copied the bulk of this guide from Andrew Miller's NixOS-On-Linode.md instructions. It's a very well-written guide, but I felt we could make things a bit more simple than he left them in his original guide.

This tutorial is written for people who want to run NixOS on a Linode instance. The installation is pretty straightforward, but it involves some bootstrapping using Linode's tools.

In this tutorial, we will show you how to set up NixOS on Linode by setting up disks (including the installation live CD) using the rescue OS, and use the minimal live CD to install NixOS onto your disk.

Create a Linode

@mkohler
mkohler / nix-development-template-file.org
Created September 27, 2021 21:01 — forked from AndersonTorres/nix-development-template-file.org
A project workflow for Nixpkgs/NixOS

Standard project structure

This is a project structure I’ve found useful. Looking for any thoughts/comments/feedback. Roughly, I found a tension between the style nixpkgs expects and the style conducive to development, so I extracted the common portion into a derivation.nix which is used by the remaining .nix files. This setup allows me to use nix build, nix-shell, overlays, Hydra, alternate packaging schemes, cross-compiling, etc.

Haskeller Competency Matrix

See also List of materials about Software Design in Haskell

Junior Middle Senior Architect
Haskell level Basic Haskell Intermediate Haskell Advanced Haskell Language-agnostic
Haskell knowledge scope Learn you a Haskell Get programming with Haskell Haskell in Depth Knows several languages from different categories
Get programming with Haskell Haskell in Depth Functional Design and Architecture
[Other books on Software Architecture in Haskell](https://github.com/graninas/software-design-in-haskell#Books-on-S
@mkohler
mkohler / Makefile
Last active August 29, 2015 14:18 — forked from isaacs/Makefile
# Hello, and welcome to makefile basics.
#
# You will learn why `make` is so great, and why, despite its "weird" syntax,
# it is actually a highly expressive, efficient, and powerful way to build
# programs.
#
# Once you're done here, go to
# http://www.gnu.org/software/make/manual/make.html
# to learn SOOOO much more.
# This is how you add a Jenkins slave
# On master:
sudo -u jenkins -H ssh-keygen
# On slave
adduser --system --group --home=/var/lib/jenkins-slave --no-create-home --disabled-password --quiet --shell /bin/bash jenkins-slave
install -d -o jenkins-slave -g jenkins-slave /var/lib/jenkins-slave
#!/bin/sh
cp postmkvirtualenv ~/.virtualenvs
@mkohler
mkohler / bash_prompt.sh
Last active December 11, 2015 11:59 — forked from insin/bash_prompt.sh
bash prompt indicating git status, git branch, active virtualenv, host, working directory, and exit code of last command.
#!/bin/bash
#
# DESCRIPTION:
#
# Set the bash prompt according to:
# * the active virtualenv
# * the branch/status of the current git repository
#
# USAGE:
#