Skip to content

Instantly share code, notes, and snippets.

View kamilchm's full-sized avatar

Kamil Chmielewski kamilchm

View GitHub Profile
@dmalikov
dmalikov / README.markdown
Last active May 31, 2019 06:31
Nix / NixOS links

Various blog posts related to Nix and NixOS


General

@jbeda
jbeda / nar-spec.md
Created September 1, 2015 23:04
Nix Archive (NAR) file specification

This is taken directly from Figure 5.2 in http://nixos.org/~eelco/pubs/phd-thesis.pdf. It is presented here to be more directly linkable.

serialise(fso) = str("nix-archive-1") + serialise1(fso)

serialise1(fso) = str("(") + seralise2(fso) + str(")")

serialise2(type=Regular, exec, contents) =
  str("type") + str("regular")
 + (
@novaluke
novaluke / 0-Q&A.md
Last active April 29, 2023 17:23
I want to use Nix for development, but... -- answers to common concerns about Nix

Nix seems perfect for developers - until I try to use it...

Want to use Nix for development but you're not sure how? Concerned about the fluidity of nixpkgs channels or not being able to easily install arbitrary package versions?

When I first heard about Nix it seemed like the perfect tool for a developer. When I tried to actually use it for developing and deploying web apps, though, the pieces just didn't seem to add up.

@philandstuff
philandstuff / codemesh2015.org
Last active November 16, 2015 19:37
Code mesh 2015 notes

Kush, an introduction to schedulers

about me

  • I work for GDS
  • Cabinet Office
  • we started by building GOV.UK
    • replaced older sites like direct gov, business link
  • we’re not just fixing websites
    • we also build and run digital services
    • working with depts across the country
    • eg: register to vote
@rvl
rvl / test-docker.nix
Last active September 28, 2020 23:22
Examples of using nixpkgs PR 11156 https://github.com/NixOS/nixpkgs/pull/11156
# How to build docker images (NIX_PATH and hydra cache required when building off master branch)
# export NIX_PATH=$HOME/dev
# nix-build --option extra-binary-caches http://hydra.nixos.org/ test-docker.nix | xargs -n1 docker load -i
with import <nixpkgs> {};
rec {
# 1. basic example
bash = dockerTools.buildImage {
name = "bash";
@Kornel
Kornel / recursive-cowsay.sh
Last active February 4, 2016 14:18
Recursive cowsay inception - random cow at every step
#!/usr/bin/env bash
COWS_PATH="/usr/local/share/cows"
COW_FILES=($(ls $COWS_PATH))
COWS=${#COW_FILES[@]}
rand_cow() {
#RAND_IDX=$(($RANDOM % $COWS))
RAND_IDX=$((`od -vAn -N4 -tu4 < /dev/urandom` % $COWS))
@sigma
sigma / redis-mini.nix
Created April 17, 2016 06:30
minimal #redis #docker image with #nix
{ pkgs ? import <nixpkgs> {} }:
with pkgs;
let
su_exec = pkgs.stdenv.mkDerivation {
name = "su-exec-0.2";
src = fetchurl {
url = https://github.com/ncopa/su-exec/archive/v0.2.tar.gz;
sha256 = "09ayhm4w7ahvwk6wpjimvgv8lx89qx31znkywqmypkp6rpccnjpc";
#!/usr/bin/python
"""
Script to migrate marathon tasks from the host going for maintenance
optional arguments:
-h, --help show this help message and exit
--url URL Marathon URL (http://marathon.example.com)
--hosts HOSTS Hosts going to go for maintenance
[signup] elm-make SignupForm.elm
Some new packages are needed. Here is the upgrade plan.
Install:
elm-lang/core 4.0.1
Do you approve of this plan? (y/n) y
Downloading elm-lang/core
Packages configured successfully!
I cannot find module 'Html.App'.
%!PS-Adobe-3.0 EPSF-3.0
%%Creator: cairo 1.14.6 (http://cairographics.org)
%%CreationDate: Thu Nov 3 14:26:49 2016
%%Pages: 1
%%DocumentData: Clean7Bit
%%LanguageLevel: 2
%%BoundingBox: 189 495 415 722
%%EndComments
%%BeginProlog
save