Skip to content

Instantly share code, notes, and snippets.

View 4z3's full-sized avatar
🦀
computering hard

tv 4z3

🦀
computering hard
View GitHub Profile
@4z3
4z3 / elm-format-wrapper.nix
Created March 24, 2021 00:12
elm-format-wrapper that allows to ignore blocks of code
{ pkgs }:
pkgs.symlinkJoin {
name = "elm-format-wrapper";
paths = [
(pkgs.writers.writeDashBin "elm-format" ''
# elm-format-wrapper 1.0.0
#
# Usage:
# elm-format [--help] [--action=ACTION] PATH...
@4z3
4z3 / awslogs.nix
Created December 8, 2016 05:13
awslogs.nix
# installation: nix-env -i $(nix-build --no-out-link -E '(import <nixpkgs> {}).callPackage ./awslogs.nix {}')
{ buildPythonPackage, fetchFromGitHub, pythonPackages }:
buildPythonPackage rec {
name = "awslogs-${src.rev}";
src = fetchFromGitHub {
owner = "jorgebastida";
repo = "awslogs";
rev = "0.7";
@4z3
4z3 / man.conf.nix
Created February 26, 2016 11:44
man.conf.nix -Wbreak
{
environment.etc."man.conf".source = pkgs.runCommand "man.conf" {} ''
${pkgs.gnused}/bin/sed <${pkgs.man}/lib/man.conf >$out '
s:^NROFF\t.*:& -Wbreak:
'
'';
}
@4z3
4z3 / Godeps.nix
Created December 12, 2015 15:50
vault-0.4.0
{ fetchgit, runCommand }:
let
srcs = {
"https://github.com/armon/go-metrics" = fetchgit {
url = https://github.com/armon/go-metrics;
rev = "6c5fa0d8f48f4661c9ba8709799c88d425ad20f0";
sha256 = "7321b4078de3fe65a76acf9bf116c18e053854f439afcde33b9d052c2cab9b0d";
};
"https://github.com/armon/go-radix" = fetchgit {
@4z3
4z3 / tv.js
Created August 8, 2015 00:19
eth tv.js
var tv = {}; (function () {
tv.txhashes = [
'0xlol',
]
function bal(a) {
return web3.fromWei(eth.getBalance(a), "ether")
}
@4z3
4z3 / gist:d1236d3218d8e28aa2d1
Last active August 29, 2015 14:25
NixOS module skeleton
{ config, lib, pkgs, ... }:
with builtins;
with lib;
let
modname = "whatever";
cfg = config.${modname};
@4z3
4z3 / env.nix
Last active August 29, 2015 14:09
nix development environment example
# usage:
# nix-env -f env.nix -i
# load-env-example-1
#
# If the directory ~/.history/ exists, then the development environment
# will use a dedicated shell history.
#
# Note: this is currently only compatible with nixos-14.11 (nixos-unstable).
#
@4z3
4z3 / gist:b0f0a87ee0744b9ea358
Last active August 29, 2015 14:08
enable cgserver on nixos

Following steps can be used to start the cgserver on NixOS:

  1. clone the "cgserver" branch of my nixpkgs repository, e.g.:

    git clone -b cgserver https://github.com/4z3/nixpkgs /tmp/cgserver-nixpkgs

  2. enable the cgserver in the /etc/nixos/configuration.nix by adding:

    services.cgserver.enable = true;

@4z3
4z3 / env.nix
Last active August 29, 2015 14:08
env.nix for lftp with custom haskell environment, d3js, and a dedicated histfile
# install with nix-env -f env.nix -i
# start with load-env-projectname
let
name = "projectname";
version = "0.1.0.0";
buildInputs = with pkgs; [
hsEnv
lftp
];
find -mindepth 1 -maxdepth 1 -type f | while read f1; do f2=$(echo $f1 | tr A-Z a-z); if test "$f1" != "$f2"; then echo mv "$f1" "$f2"; fi; done