Skip to content

Instantly share code, notes, and snippets.

View markus1189's full-sized avatar

Markus Hauck markus1189

  • Frankfurt am Main, Germany
View GitHub Profile
@markus1189
markus1189 / ZipArchiveStream.scala
Created July 3, 2019 08:10
Streaming creation of a zip archive with akka-streams
import java.io.ByteArrayOutputStream
import java.nio.charset.StandardCharsets
import java.nio.file.{Path, Paths}
import java.util.zip.{ZipEntry, ZipOutputStream}
import akka.NotUsed
import akka.actor.ActorSystem
import akka.stream.{ActorMaterializer, IOResult}
import akka.stream.scaladsl.{FileIO, Flow, Keep, Source}
import akka.util.ByteString
@markus1189
markus1189 / docker.nix
Last active January 4, 2019 15:12
DockerTools Problem
{ pkgs ? import <nixpkgs> {} }: with pkgs.dockerTools;
let
someBaseImage = pullImage {
imageName = "nixos/nix";
imageDigest = "sha256:1b97dc98b599779d80271d4203275627c0749d8bd5e9b9c868154249395cbc1b";
sha256 = "134h20xgpqchcvgv0f13knsi2p7jfl4m9mk8hkvdgh8hnz0hj3hc";
};
in
buildImage {
@markus1189
markus1189 / docker.nix
Created January 4, 2019 15:07
DockerTools Problem
{ pkgs ? import <nixpkgs> {} }: with pkgs.dockerTools;
let
someBaseImage = pullImage {
imageName = "nixos/nix";
imageDigest = "sha256:1b97dc98b599779d80271d4203275627c0749d8bd5e9b9c868154249395cbc1b";
sha256 = "134h20xgpqchcvgv0f13knsi2p7jfl4m9mk8hkvdgh8hnz0hj3hc";
};
in
buildImage {
@markus1189
markus1189 / dyalog.nix
Last active December 19, 2018 17:52
WIP of packaging Dyalog APL using nix
{ pkgs ? import <nixpkgs> {}}: with pkgs;
let
libPath = stdenv.lib.makeLibraryPath (with pkgs.xorg; [
alsaLib
atk
cairo
cups
dbus_daemon.lib
expat
@markus1189
markus1189 / shell.nix
Created July 15, 2018 08:33
nix shell environment for the "category for programmers" latex build
# Run this command to build the pdf:
# > nix-shell --pure shell.nix --command 'cd src; make'
{ pkgs ? import <nixpkgs> {} }: with pkgs;
mkShell {
FONTCONFIG_FILE = makeFontsConf { fontDirectories = [ inconsolata-lgc libertine libertinus ]; };
buildInputs = [
(texlive.combine {
inherit (texlive)
fvextra
// -*- compile-command: "scalafmt Code.scala && amm Code.scala" -*-
/*
Code for the Java-Magazin Article
Author: Markus Hauck, codecentric AG
You can execute this using ammonite (http://ammonite.io/#Ammonite-REPL)
> amm Code.scala
Alternatively, you can take all $ivy imports and build an sbt project yourself
*/
@markus1189
markus1189 / desktopdungeons.nix
Last active February 6, 2018 06:28
DesktopDungeons on Nix(OS)
# Nix build file for Desktop Dungeons
# nix-build --argstr savesDir ~/DDSaves DesktopDungeons.nix
{ pkgs ? import <nixpkgs> { system = "i686-linux";}
, savesDir
}: with pkgs;
assert lib.pathExists savesDir;
stdenv.mkDerivation rec {
name = "desktop-dungeons";
@markus1189
markus1189 / zoom.nix
Last active January 17, 2018 19:44
Nix build for the zoom client from zoom.us
{ pkgs ? import <nixpkgs> {} }: with pkgs;
stdenv.mkDerivation rec {
name = "zoom-${version}";
version = "2.0.115900.1201";
src = fetchurl {
url = "https://zoom.us/client/${version}/zoom_x86_64.tar.xz";
sha256 = "1ssd1mdmbxdf5b2drv23ag8hznlj29b1qaldsn3gpn94mzvh6nrl";
};
@markus1189
markus1189 / keybase.md
Last active January 14, 2018 09:04
keybase.md

Keybase proof

I hereby claim:

  • I am markus1189 on github.
  • I am markus1189 (https://keybase.io/markus1189) on keybase.
  • I have a public key ASBPUi8X0YfGs5fiDuxchE5N7am75W2C1qrb0U6lu-mUFgo

To claim this, I am signing this object:

@markus1189
markus1189 / scalafmt-nixexpr.hs
Last active December 8, 2017 08:37
Scalafmt nixpkgs generator
#! /usr/bin/env nix-shell
#! nix-shell -i 'runhaskell --ghc-arg=-threaded'
#! nix-shell -p 'ghc.withPackages (p: with p; [ turtle text hnix ])'
#! nix-shell -p coursier nix
#! nix-shell --pure
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TupleSections #-}
import qualified Control.Foldl as Foldl