Skip to content

Instantly share code, notes, and snippets.

View garbas's full-sized avatar
🏠
Working from home

Rok Garbas garbas

🏠
Working from home
View GitHub Profile
{}:
let
pkgs = import <nixpkgs> {};
run_app = pkgs.writeScriptBin "run-app" ''
#!/bin/sh
/bin/python -m SimpleHTTPServer ''${PORT:=5000}
'';
in pkgs.dockerTools.buildImage {
@garbas
garbas / default.nix
Last active July 31, 2016 08:45
heroku-cli
{}:
let
pkgs = import <nixpkgs> {};
in import ./heroku-cli.nix {
inherit (pkgs) stdenv git curl cacert cowsay jq openssl python fetchFromGitHub;
go = pkgs.go_1_6;
goPackages = pkgs.go16Packages;
nodejs = pkgs.nodejs-5_x;
}
[nix-shell] ~/d/m/r/s/r/neo ❯❯❯ npm run test
> [email protected] test /home/rok/dev/mozilla/relengapi/src/relengapi_tools/neo
> karma start
03 05 2016 17:22:13.417:ERROR [config]: Invalid config file!
SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:373:25)
at Object.Module._extensions..js (module.js:416:10)
@garbas
garbas / builder.sh
Created January 4, 2016 16:18
VidyoDesktop
source $stdenv/setup
PATH=$dpkg/bin:$PATH
dpkg -x $src unpacked
mkdir -p $out/bin
cp -r unpacked/* $out/
ln -s $out/usr/bin/VidyoDesktop $out/bin/VidyoDesktop
touch $out/etc/issue
@garbas
garbas / nix
Last active May 18, 2016 18:56
nix porcelain
#!/usr/bin/env nix-shell
#!nix-shell -i python -p pythonPackages.click
import click
import shlex
import subprocess
# helper methods
nixos-rebuild:
nix-env -p container -I nixos-config=`pwd`/configuration.nix -f "<nixpkgs/nixos>" --set -A system
nixos-create: nixos-rebuild
sudo nixos-container create shoppimon --system-path `realpath container`
nixos-update: nixos-stop nixos-rebuild nixos-start
nixos-stop:
sudo nixos-container stop shoppimon
~ ❯❯❯ sudo nix-channel --update
[sudo] password for rok:
downloading Nix expressions from ‘http://nixos.org/releases/nixos/unstable/nixos-16.03pre71289.7ae05ed//nixexprs.tar.xz’...
downloading ‘http://nixos.org/releases/nixos/unstable/nixos-16.03pre71289.7ae05ed//nixexprs.tar.xz’... [6618/6937 KiB, 1088.5 KiB/s]
downloading Nix expressions from ‘http://nixos.org/releases/nixpkgs/nixpkgs-16.03pre71138.91bc2e9//nixexprs.tar.xz’...
downloading ‘http://nixos.org/releases/nixpkgs/nixpkgs-16.03pre71138.91bc2e9//nixexprs.tar.xz’... [5581/6086 KiB, 1105.9 KiB/s]
unpacking channels...
error: syntax error, unexpected $end, at /nix/store/vmv151wx9l8dlbq14j61fvp2f44qc3nh-env-manifest.nix:1:1
cannot unpack the channels at /run/current-system/sw/bin/nix-channel line 169
diff --git a/pkgs/development/compilers/sbcl/bootstrap.nix b/pkgs/development/compilers/sbcl/bootstrap.nix
index 6e9124a..eb03b25 100644
--- a/pkgs/development/compilers/sbcl/bootstrap.nix
+++ b/pkgs/development/compilers/sbcl/bootstrap.nix
@@ -23,6 +23,11 @@ let
sha256 = "0sp5445rbvms6qvzhld0kwwvydw51vq5iaf4kdqsf2d9jvaz3yx5";
};
armv6l-linux = armv7l-linux;
+ x86_64-freebsd = {
+ version = "1.2.7";
@garbas
garbas / nix2ncdu.py
Created August 27, 2015 03:21
nix-store --tree to ncdu format
import sys
import os
import json
import time
import subprocess
def set_item(tree, items, info):
item = items[0]
preConfigure = if stdenv.system == "i686-cygwin" then ''
export HOMEPATH="\\homeless-shelter"
export NUMBER_OF_PROCESSORS="1"
'' else null;