Skip to content

Instantly share code, notes, and snippets.

View bencoman's full-sized avatar
💭
not much

Ben Coman bencoman

💭
not much
  • Western Australia
View GitHub Profile
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running ‘nixos-help’).
{ config, pkgs, ... }:
{
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
with import <nixpkgs> {};
with stdenv.lib;
let
mkGnFlags =
let
# Serialize Nix types into GN types according to this document:
# https://chromium.googlesource.com/chromium/src/+/master/tools/gn/docs/language.md
mkGnString = value: "\"${escape ["\"" "$" "\\"] value}\"";
{ stdenv, ninja, which, nodejs, fetchurl, gnutar
# default dependencies
, bzip2, flac, speex, libopus
, libevent, expat, libjpeg, snappy
, libpng, libcap
, xdg_utils, yasm, minizip, libwebp
, libusb1, pciutils, nss, re2, zlib, libvpx
, python2Packages, perl, pkgconfig
$ git clone https://github.com/nixos/nixpkgs
$ export NIXPKGS=`pwd`/nixpkgs
$ ls $NIXPKGS
The build phases listed https://nixos.wiki/wiki/Create_and_debug_nix_packages#Using_nix-shell_for_package_development
unpackPhase
patchPhase
configurePhase
buildPhase
* Installed per https://chris-martin.org/2015/installing-nixos
but without the encrypted partition
* Instead of DEVICE=/dev/mapper/enc-pv
* rather DEVICE=/dev/sda3
* pvcreate $DEVICE
* vgcreate vg $DEVICE
* Couldn't get wpa_supplicant to work from the install environment,
so before doing... $ nixos-install
* cabled into to internet gateway
# This file: default.nix
#
# Being new to NixOS, I don't understand everything below. I culled and modified it from...
# https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/networking/browsers/chromium/default.nix
# which integrates pdfium as its PDF viewer.
#
# Currently `nix-shell` then `unpackPhase` produces an error "unpacker produced multiple directories"
# Reading around, it seemed that uncommenting the #unpackPhase= group might avoid that error, but no dice.
# Looking for some assistance to unpack the tarball.
@bencoman
bencoman / gist:a145fc9a2b084ef9125b1804b5d47411
Created June 28, 2016 15:02
rebase.missingCommitsCheck question
$ git config --global rebase.missingCommitsCheck warn
$ git checkout -b testMissingCommitsCheckWarn master
$ for N in 1 2 3 4 ; do (echo $N >> blah ; git commit -am $N) ; done
$ cat blah ; git log --oneline
# as above
$ git rebase -i master
# in editor, delete commit 2 line, save, exit