Skip to content

Instantly share code, notes, and snippets.

View ixxie's full-sized avatar
📡
Exploring new possibilities

Matan Bendix Shenhav ixxie

📡
Exploring new possibilities
  • Montdenis, France
  • 23:31 (UTC +02:00)
View GitHub Profile
@ixxie
ixxie / rebuild-config
Created January 4, 2017 10:09
Templating Nix Configurations
#!/usr/bin/env bash
set -e
fluxlib bash
# this builds configuration files from templates
# it takes a template for a nix expression and replaces
# certain variables with values stored in some files.
function maketemp
{ pkgs, stdenv}:
let
version = "0.0.1";
in stdenv.mkDerivation
{
name = "script-${version}";
@ixxie
ixxie / flux.nix
Created April 16, 2017 16:59
Nix Command Line Tool
{ pkgs, stdenv}:
# flux
# bin/
# flux.sh
# lib/
# subcom1
# subcom2
# ...
# flux.nix
@ixxie
ixxie / flux.sh
Last active April 16, 2017 17:29
New version (flux.sh is in bin/ )
#!/usr/bin/env bash
set -e
# Main flux script
# Look for scripts in this directory
BINDIR="$(dirname "$0")"
LIBDIR="$(dirname ${BINDIR})/lib"
# Execute commands
$ sudo nixos-rebuild switch --show-trace
building Nix...
building the system configuration...
trace: { rev = "5277d96745afcc04a0873102f4a5f80cfc68fa23"; sha256 = "17h2ijb50q76al72hpggv35bbqiayyzvybmfwyx1cr5xzlpvzcqh"; url = "https://github.com/teozkr/Sbtix"; }
error: while evaluating the attribute ‘buildCommand’ of the derivation ‘nixos-system-meso-17.03.1160.f2c4af4e3b’ at /nix/var/nix/profiles/per-user/root/channels/nixos/nixpk
gs/nixos/modules/system/activation/top-level.nix:107:7:
while evaluating the attribute ‘sources’ of the derivation ‘etc’ at /nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs/nixos/modules/system/etc/etc.nix:12:5:
while evaluating anonymous function at /nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs/nixos/modules/system/etc/etc.nix:20:20, called from undefined position:
while evaluating the attribute ‘source’ at /nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs/lib/attrsets.nix:199:44:
while evaluating anonymous function at /nix/var/nix/profiles/per-user/r
@ixxie
ixxie / error
Last active June 28, 2017 20:00
Streaming git repos into NixOS
error: while evaluating the attribute ‘buildCommand’ of the derivation ‘nixos-system-meso-17.03.1395.9b948ea439’ at /nix/var/nix/profiles/per-user/root/channels/nixos/nixpk
gs/nixos/modules/system/activation/top-level.nix:107:7:
while evaluating the attribute ‘sources’ of the derivation ‘etc’ at /nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs/nixos/modules/system/etc/etc.nix:12:5:
while evaluating anonymous function at /nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs/nixos/modules/system/etc/etc.nix:20:20, called from undefined position:
while evaluating the attribute ‘source’ at /nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs/lib/attrsets.nix:199:44:
while evaluating anonymous function at /nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs/lib/modules.nix:75:45, called from /nix/var/nix/profiles/per-user/root/cha
nnels/nixos/nixpkgs/lib/attrsets.nix:199:52:
while evaluating the attribute ‘value’ at /nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs/lib/modules.n
{ config, pkgs, ... }:
{
nixpkgs.config =
{
# Allow proprietary packages
allowUnfree = true;
@ixxie
ixxie / output
Last active November 20, 2017 19:03
these derivations will be built:
/nix/store/gs7vy9gd6cdm14jyzkk5zvi7a99g5p05-python3.6-jupyterhub-0.8.1.drv
building path(s) ‘/nix/store/llfk8qxk218gya1awili8akrdj3gfcjc-python3.6-jupyterhub-0.8.1’
unpacking sources
unpacking source archive /nix/store/16c26vhfd7wni4qzmzp6vsxkr17k90pz-jupyterhub-0.8.1.tar.gz
source root is jupyterhub-0.8.1
setting SOURCE_DATE_EPOCH to timestamp 1510058379 of file jupyterhub-0.8.1/PKG-INFO
patching sources
configuring
building
{ pkgs, myFunc, ... }:
myFunc {
x = path.to.stuff;
}
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.services.jupyterlab;
kernels = (pkgs.jupyterKernels.create {