Skip to content

Instantly share code, notes, and snippets.

diff --git a/machine.go b/machine.go
index 4399029..ddb3be2 100644
--- a/machine.go
+++ b/machine.go
@@ -27,7 +27,7 @@ const (
ErrCouldNotConvertMachineInterface = Error("failed to convert machine interface")
ErrHostnameTooLong = Error("Hostname too long")
ErrDifferentRegisteredNamespace = Error("machine was previously registered with a different namespace")
- MachineGivenNameHashLength = 8
+ MachineGivenNameHashLength = 0
{ lib }:
{
# Converts given object to TOML text.
toTOML =
let
toInlinePair = name: value: "${builtins.toJSON name} = ${toPlainTOMLValue value}";
toPlainTOMLValue = value:
if lib.isList value then
#!/usr/bin/env python3
import pty
import termios
import sys
import tty
import os
FROM_STR = b"#"
TO_STR = "🦃".encode("utf-8")
FROM steam-runtime
RUN apt-get install -y autoconf automake
COPY ponscripter-fork-wh /root/ponscripter-fork-wh
WORKDIR /root/ponscripter-fork-wh
RUN ./configure
RUN make
@abbradar
abbradar / test.nix
Created November 11, 2017 10:16
Test for makeWrapper
{ stdenv, makeWrapper }:
stdenv.mkDerivation {
name = "make-wrapper-test";
buildInputs = [ makeWrapper ];
buildCommand = ''
mkdir -p $out/bin
cat > $out/bin/test <<EOF
import List
import Signal exposing (Mailbox)
import Time exposing (Time)
import Task exposing (Task)
import Color exposing (Color)
import Random exposing (Seed)
import Window
import Debug
import Graphics.Element exposing (Element)
import Graphics.Collage as Collage exposing (Shape)
@abbradar
abbradar / Solver.hs
Last active June 8, 2017 15:30
Solver for puzzles in 999
{-# LANGUAGE ScopedTypeVariables, ViewPatterns, TupleSections #-}
module Solver999 where
import Data.List
import Control.Monad
import Data.Set (Set)
import qualified Data.Set as S
import Data.Map (Map)
import qualified Data.Map as M
In file included from ext/tracy/include/tracy/write_to_file.hpp:9:0,
from ext/tracy/include/tracy/tracer.hpp:19,
from ext/tracy/include/tracy/tracy.hpp:10,
from ext/tracy/include/tracy/logger.hpp:6,
from ext/gate-common/include/gate/sbe_misc.hpp:6,
from src/test_replace.cpp:16:
ext/jsoncons/src/jsoncons/json.hpp: In instantiation of ‘jsoncons::value_type jsoncons::basic_json<CharT, JsonTraits, Allocator>::variant::type_id() const [with CharT = char; JsonTraits = jsoncons::json_traits<char>; Allocator = std::allocator<char>]’:
ext/jsoncons/src/jsoncons/json.hpp:3047:9: required from ‘jsoncons::basic_json<CharT, JsonTraits, Allocator>::json_type jsoncons::basic_json<CharT, JsonTraits, Allocator>::get(jsoncons::basic_json<CharT, JsonTraits, Allocator>::string_view_type, T&&) const [with T = const char (&)[4]; CharT = char; JsonTraits = jsoncons::json_traits<char>; Allocator = std::allocator<char>; jsoncons::basic_json<CharT, J
@abbradar
abbradar / shell.nix
Created January 10, 2017 21:05
Nix FHS env for OpenWrt
{ pkgs ? import <nixpkgs> {} }:
let
fixWrapper = pkgs.runCommand "fix-wrapper" {} ''
mkdir -p $out/bin
for i in ${pkgs.gcc.cc}/bin/*-gnu-gcc*; do
ln -s ${pkgs.gcc}/bin/gcc $out/bin/$(basename "$i")
done
for i in ${pkgs.gcc.cc}/bin/*-gnu-{g++,c++}*; do
ln -s ${pkgs.gcc}/bin/g++ $out/bin/$(basename "$i")
@abbradar
abbradar / nix.sh
Last active February 11, 2017 08:01
if [ -n "$HOME" ]; then
export NIX_REMOTE=daemon
export NIX_USER_PROFILE_DIR=/nix/var/nix/profiles/per-user/$USER
mkdir -m 0755 -p $NIX_USER_PROFILE_DIR
if test "$(stat --printf '%u' $NIX_USER_PROFILE_DIR)" != "$(id -u)"; then
echo "WARNING: bad ownership on $NIX_USER_PROFILE_DIR" >&2
fi