This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# as of this gist, tigervnc fails to build on the latest nix channel. | |
# this gist demonstrates using older build to launch it, with openbox | |
nix-channel --add https://nixos.org/channels/nixos-18.09 | |
nix-channel --update | |
export DISPLAY=:1 | |
export NIX_PATH=nixpkgs=/nix/var/nix/profiles/per-user/$USER/channels/nixos-18.09 | |
# for changing the geometry online, see https://stackoverflow.com/a/38630417 | |
case $1 in |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# set up base alpine image | |
ADMINUSER=$1 | |
if [ ! -e nixos-docker ]; then | |
git clone https://github.com/NixOS/docker nixos-docker | |
fi | |
pushd nixos-docker > /dev/null | |
git checkout Dockerfile | |
cp Dockerfile Dockerfile.orig | |
cat Dockerfile.orig | | |
sed "s/addgroup/sudo addgroup/" | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let | |
pkgs = import <nixpkgs> {}; | |
stdenv = pkgs.stdenv; | |
in stdenv.mkDerivation rec { | |
name = "env"; | |
env = pkgs.buildEnv { name = name; paths = buildInputs; }; | |
buildInputs = [ | |
pkgs.buildah | |
pkgs.conmon | |
pkgs.podman |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# sets up a working jupyter notebook environment with | |
# - bash kernel support | |
# - jupyter_nbextensions_configurator with ExecuteTime enabled | |
# - jupytext | |
# tested on | |
# - CentOS, macos using nix==2.2.2 | |
# - docker://ubuntu:latest using nix==2.1.3 | |
# to connect to a remote host via ssh in bash_kernel, use: | |
# ssh target-hostname -t 'PS1="[PEXPECT_PROMPT>" bash --norc --noprofile' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ref: http://www.jaakkoluttinen.fi/blog/conda-on-nixos/ | |
# ref: https://github.com/NixOS/nixpkgs/blob/af9d10a91b5ef0518ee12b220470735076974210/pkgs/tools/package-management/conda/default.nix | |
with import <nixpkgs> {}; | |
let | |
condaDeps = [ stdenv.cc xorg.libSM xorg.libICE xorg.libXrender libselinux ]; | |
extraPkgs = [ which ]; | |
python_version = "2"; | |
conda_version = "4.6.14"; | |
src = fetchurl { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from IPython.core.display import display, HTML | |
from lib.renderer import browser as brend | |
import ipywidgets as widgets | |
from IPython.display import display | |
def jupyter_display_table(entries, exclude_headers=None): | |
headers = list(set([k for entry in entries for k in entry.keys()])) | |
for hdr in (exclude_headers or []): | |
headers.remove(hdr) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ stdenv, hostPlatform, fetchurl | |
, bzip2 | |
, gdbm | |
, fetchpatch | |
, ncurses | |
, openssl | |
, readline | |
, sqlite | |
, tcl ? null, tk ? null, tix ? null, xlibsWrapper ? null, libX11 ? null, x11Support ? false | |
, zlib |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ $# -lt 1 ]; then | |
cat <<EOF | |
Usage: $0 <directory> [tabwidth] | |
This script outputs a table of file information from the contents of <directory> like: | |
time type perm uid size mime hash path target | |
4444 file -rw- 0 1111 text/... abcd /x/f |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let | |
pkgs = import <nixpkgs> {}; | |
stdenv = pkgs.stdenv; | |
in stdenv.mkDerivation rec { | |
name = "quick"; | |
env = pkgs.buildEnv { name = name; paths = buildInputs; }; | |
buildInputs = [ | |
pkgs.python27Packages.virtualenv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
with import <nixpkgs> {}; | |
stdenv.mkDerivation rec { | |
name = "dev-env"; | |
env = pkgs.buildEnv { | |
name = name; | |
paths = buildInputs; | |
}; | |
buildInputs = [ | |
(vim_configurable.override { |
NewerOlder