Skip to content

Instantly share code, notes, and snippets.

View aforemny's full-sized avatar
turning coffee into bugs

Alexander Foremny aforemny

turning coffee into bugs
View GitHub Profile
ec2-info.nix:
{ config, pkgs, ... }:
with pkgs.lib;
{
deployment.ec2.keyPair = "id_rsa-ec2";
deployment.ec2.privateKey = mkDefault "/home/aforemny/.ssh/id_rsa-ec2-${config.deployment.ec2.region}";
deployment.ec2.securityGroups = mkDefault [ "default" ];
}
trivial.nix:
{
network.description = "Web server";
machine =
{ config, pkgs, ... }:
{ };
}
trivial-ec2.nix:
% cat /etc/nix/nix.conf
# WARNING: this file is generated.
build-users-group = nixbld
build-max-jobs = 2
build-use-chroot = false
build-chroot-dirs = /dev /dev/pts /proc /bin /nix/store/043zrsanirjh8nbc5vqpjn93hhrf107f-bash-4.2-p24 /nix/store/27116bbxhi8dd7l2fjjfbwj6p35ql7n7-readline-6.2 /nix/store/4gv9gby4bn1y0rlw3k0d5lyqy0yfkrc6-gcc-4.6.3 /nix/store/ahg5mlj2mlp7yfl3x875pq95ar763vgj-ncurses-5.9 /nix/store/cj7a81wsm1ijwwpkks3725661h3263p5-glibc-2.13 /nix/store/i3mqzy76lf51v5zqxjxyvf11j25iwycd-zlib-1.2.7 /nix/store/jfcs9xnfbmiwqs224sb0qqsybbfl3sab-linux-headers-2.6.35.14 /nix/store/qvs2rj2ia5vci3wsdb7qvydrmacig4pg-bash-4.2-p24
binary-caches = http://nixos.org/binary-cache
trusted-binary-caches = http://hydra.nixos.org
% nix-env -iA haskellEnv --option binary-caches http://hydra.nixos.org
@aforemny
aforemny / git.nix
Created March 14, 2013 14:22
Git repository management
{ config, pkgs, ... }:
with pkgs.lib;
let
mainCfg = config.services.git;
repositoryOpts = { name, config, ... }: {
@aforemny
aforemny / git.nix
Created March 14, 2013 15:21
Simple Git repository management
{ config, pkgs, ... }:
with pkgs.lib;
let
mainCfg = config.services.git;
repositoryOpts = { name, config, ... }: {
aforemny@nixos (master) % nix-env -q \*|grep ghc ~
ghc-7.6.2-wrapper
haskell-xmonad-contrib-ghc7.6.2-0.11
haskell-xmonad-extras-ghc7.6.2-0.11
haskell-xmonad-ghc7.6.2-0.11
aforemny@nixos (master) % cat ~/.xmonad/xmonad.hs ~
module Main where
import Control.Applicative
import Control.Concurrent
aforemny@nixos (master) % EM_IGNORE_SANITY=true emcc test.c
(Emscripten: settings file has changed, clearing cache)
EM_IGNORE_SANITY set, ignoring sanity checks
Traceback (most recent call last):
File "/nix/store/9zdbs1wkbld25z5f882mw2rk2hivm8gm-emscripten/lib/.emcc-wrapped", line 1291, in <module>
final = shared.Building.emscripten(final, append_ext=False, extra_args=extra_args)
File "/nix/store/9zdbs1wkbld25z5f882mw2rk2hivm8gm-emscripten/lib/tools/shared.py", line 942, in emscripten
compiler_output = jsrun.timeout_run(Popen([PYTHON, EMSCRIPTEN, filename + ('.o.ll' if append_ext else ''), '-o', filename + '.o.js'] + settings + extra_args, stdout=PIPE), None, 'Compiling')
File "/nix/store/yzj6p5f7iyh247pwxrg97y3klm6d0cni-python-2.7.3/lib/python2.7/subprocess.py", line 679, in __init__
errread, errwrite)
@aforemny
aforemny / DynamicInputFields.elm
Created March 8, 2014 18:50
Multiple independent input fields based on the input of a single field
-- This is compiles against 0eae99a737618aaa4d9c7fbd709cf7d6441ddee8.
module DynamicInputFields where
import Graphics.Input (..)
import Graphics.Input.Field (..)
import String
import Dict ( Dict )
import Dict
@aforemny
aforemny / InputField.elm
Created March 9, 2014 09:32
Example demonstrating field bug with Firefox 27.0.1
module InputField where
import Graphics.Input.Field (..)
import Graphics.Input (..)
a = input noContent
f = field defaultStyle a.handle id "Firefox users cannot type in here."
main = lift f a.signal
@aforemny
aforemny / FieldDimensions.elm
Created March 9, 2014 12:10
Example demonstrating field resize bug
module FieldDimensions where
import Graphics.Input.Field ( field, defaultStyle, noContent )
import Graphics.Input ( input, button )
-- Create a button that toggles between input "a" and "b"
toggle = input ()
btn = button toggle.handle () "a or b?"