Skip to content

Instantly share code, notes, and snippets.

View lucabrunox's full-sized avatar

Luca Bruno lucabrunox

View GitHub Profile
{ pkgs ? import <nixpkgs> {} }:
with pkgs;
let
redis_3_0_7 = pkgs.redis.overrideDerivation (attrs: rec {
version = "3.0.7";
name = "redis-${version}";
src = fetchurl {
url = "http://download.redis.io/releases/${name}.tar.gz";
sha256 = "08vzfdr67gp3lvk770qpax2c5g2sx8hn6p64jn3jddrvxb2939xj";
{ pkgs ? import <nixpkgs> {} }:
with pkgs;
let
redis_3_0_7 = pkgs.redis.overrideDerivation (attrs: rec {
version = "3.0.7";
name = "redis-${version}";
src = fetchurl {
url = "http://download.redis.io/releases/${name}.tar.gz";
sha256 = "08vzfdr67gp3lvk770qpax2c5g2sx8hn6p64jn3jddrvxb2939xj";
{ pkgs ? import <nixpkgs> {} }:
with pkgs;
let
redis = pkgs.redis.overrideDerivation (attrs: rec {
name = "redis-2.8.23";
src = fetchurl {
url = "http://download.redis.io/releases/${name}.tar.gz";
sha256 = "1kjsx79jhhssh5k9v17s9mifaclkl6mfsrsv0cvi583qyiw9gizk";
};
{ pkgs ? import <nixpkgs> {} }:
with pkgs;
dockerTools.buildImage {
name = "redis";
runAsRoot = ''
#!${stdenv.shell}
${dockerTools.shadowSetup}
groupadd -r redis
useradd -r -g redis -d /data -M redis
{ pkgs ? import <nixpkgs> {} }:
with pkgs;
let
entrypoint = writeScript "entrypoint.sh" ''
#!${stdenv.shell}
set -e
# allow the container to be started with `--user`
if [ "$1" = "redis-server" -a "$(${coreutils}/bin/id -u)" = "0" ]; then
{ pkgs ? import <nixpkgs> {} }:
with pkgs;
dockerTools.buildImage {
name = "redis";
runAsRoot = ''
#!${stdenv.shell}
${dockerTools.shadowSetup}
groupadd -r redis
useradd -r -g redis -d /data -M redis
@lucabrunox
lucabrunox / md5.go
Created January 23, 2015 12:00
Incremental golang md5
package main
/*
#include <openssl/md5.h>
*/
import "C"
import (
"errors"
"unsafe"
{ nixpkgs }:
let
release = import "${nixpkgs}/pkgs/top-level/release.nix" { inherit nixpkgs; supportedSystems = [ "x86_64-linux" ]; };
in
{
inherit (release) file;
}
{ supportedSystems ? [ "x86_64-linux" "i686-linux" ] }:
import <nixpkgs/nixos/release-combined.nix> { inherit supportedSystems; }
@lucabrunox
lucabrunox / autotools.nix
Last active December 2, 2021 18:16
Nix pill 12
pkgs: attrs:
with pkgs;
let defaultAttrs = {
builder = "${bash}/bin/bash";
args = [ ./builder.sh ];
setup = ./setup.sh;
baseInputs = [ gnutar gzip gnumake gcc binutils coreutils gawk gnused gnugrep patchelf findutils ];
buildInputs = [];
system = builtins.currentSystem;
};