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
@garbas
garbas / gista-file
Last active December 3, 2016 21:02
Minimal ipset docker image
{ pkgs ? import <nixpkgs> {} # you might want to pin it to specific revision
# to make it reproducible.
}:
let
# docs about dockerTools.buildImage are in the manual here:
# http://nixos.org/nixpkgs/manual/#sec-pkgs-dockerTools
mkDocker = ipset: pks.dockerTools.buildImage {
@garbas
garbas / gista-file
Created November 22, 2016 19:07
Profit with Nix!
{ allowUnfree = true; # allow packages like skype to be installed
allowBroken = true; # you probably want this since on osx since quite
# some packages are marked as not tested (aka broken)
# on darwin platform. packages that are marked as
# broken/untested will be build from source (no binary
# exists for them)
allowUnfreeRedistributable = true;
# some packages require this option to be set
# explicitly. this is sometimes a way to "confirm" that
# you agree with terms and conditions of upstream
@garbas
garbas / Hawk.elm
Created November 17, 2016 14:27
hawk
port module Hawk exposing (..)
import Http
import TaskclusterLogin
type Msg
= AddHeader Http.Settings Http.Request TaskclusterLogin.Model
| SendRequest Http.Settings Http.Request
@garbas
garbas / Main.elm
Created November 17, 2016 14:21
something
module Main exposing (main)
import Http
import Html.App as App
import Html exposing (..)
import Html.Attributes exposing (..)
import Html.Events exposing (..)
-- MODEL
@garbas
garbas / pycharm.nix
Created September 5, 2016 09:32
pycharm
with import <nixpkgs> {}; rec {
pycharm = stdenv.mkDerivation rec {
name = "pycharm-community-mau";
version = "2016.2.2";
src = fetchurl {
url = https://download.jetbrains.com/python/pycharm-community-2016.2.2.tar.gz;
sha256 = "6bf50910355f680983246ab51f7a082ae6f34f799db222986c1c59003bf1dbec";
};
buildInputs = [ jdk makeWrapper ];
installPhase = ''
@garbas
garbas / Clobberer.elm
Last active September 30, 2016 17:19
custom headers dont work
module App.Clobberer exposing (..)
import Dict exposing ( Dict )
import Focus exposing ( set, create, Focus, (=>) )
import Html exposing ( Html, div, text )
import Http
import Json.Decode as JsonDecode exposing ( (:=) )
import RemoteData as RemoteData exposing ( WebData, RemoteData(Loading) )
import RouteUrl.Builder exposing ( Builder, builder, replacePath )
import Task exposing ( Task )
@garbas
garbas / main.rs
Created July 5, 2016 14:48
nix-installer as garbas is learning rust :)
extern crate clap;
extern crate rand;
extern crate tar;
extern crate bzip2;
extern crate walkdir;
use bzip2::read::BzDecoder;
use clap::{Arg, App};
use rand::Rng;
use std::env;
Build failed, waiting for other jobs to finish...
error: failed to run custom build command for `mozjs_sys v0.0.0 (https://github.com/servo/mozjs#2af5849a)`
Process didn't exit successfully: `/home/rok/dev/mozilla/servo/target/debug/build/mozjs_sys-661d4efe7c7ca939/build-script-build` (exit code: 101)
--- stdout
touch /home/rok/dev/mozilla/servo/.cargo/git/checkouts/mozjs-fa11ffc7d4f1cc2d/master/mozjs/js/src/configure
cd /home/rok/dev/mozilla/servo/target/debug/build/mozjs_sys-661d4efe7c7ca939/out && \
PYTHON="/nix/store/mbf2m45krqpdx45haa6rn9ipwwivlp16-python-2.7.11/bin/python" \
MOZ_TOOLS="" CC="gcc" CPP="gcc -E" CXX="g++" AR="ar" \
/home/rok/dev/mozilla/servo/.cargo/git/checkouts/mozjs-fa11ffc7d4f1cc2d/master/mozjs/js/src/configure --disable-jemalloc --disable-js-shell --disable-tests --disable-shared-js --without-intl-api || (cat config.log && exit 1)
Traceback (most recent call last):
~/d/n/nixpkgs ❮❮❮ nix-build -A neovim ⏎
these derivations will be built:
/nix/store/dcj43452bn5ggfimlmiwp7f77708w1q7-neovim-0.1.4.drv
building path(s) ‘/nix/store/6lwlz01ydq0zq8r6pg3wns599rldzxx6-neovim-0.1.4’
unpacking sources
unpacking source archive /nix/store/ah6792mkwhn680l0jjwgb61waw1365vd-neovim-v0.1.4-src
source root is neovim-v0.1.4-src
patching sources
configuring
fixing cmake files...
@garbas
garbas / default.nix
Created May 27, 2016 09:42
garbas-docker
{}:
let
pkgs = import <nixpkgs> {};
run_app = pkgs.writeScriptBin "run-app" ''
#!/bin/sh
/bin/python -m SimpleHTTPServer ''${PORT:=5000}
'';
in pkgs.dockerTools.buildImage {