Skip to content

Instantly share code, notes, and snippets.

View gist:eb6c19b1b28ee8becc0d602e7428f2fd
default = {
type = "app";
program = with args.unstable.legacyPackages.x86_64-linux;
(writeShellApplication {
name = "hash-me.sh";
runtimeInputs = [coreutils];
text = ''
self=$(echo ${self.outPath} | cut -d/ -f4)
rev=${builtins.toString (self.revCount or 0)}
lastMod=${builtins.toString (self.lastModified or 0)}
View preloadNSS_timeout
...
08:36:47 read(3, "", 512) = 0
08:36:47 newfstatat(3, "", {st_mode=S_IFREG|0644, st_size=62, ...}, AT_EMPTY_PATH) = 0
08:36:47 close(3) = 0
08:36:47 openat(AT_FDCWD, "/nix/store/mij848h2x5wiqkwhg027byvmf9x3gx7y-glibc-2.33-50/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
08:36:47 openat(AT_FDCWD, "/nix/store/mij848h2x5wiqkwhg027byvmf9x3gx7y-glibc-2.33-50/lib/libnss_mymachines.so.2", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
08:36:47 openat(AT_FDCWD, "/nix/store/mij848h2x5wiqkwhg027byvmf9x3gx7y-glibc-2.33-50/lib/libnss_mdns_minimal.so.2", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
08:36:47 openat(AT_FDCWD, "/nix/store/mij848h2x5wiqkwhg027byvmf9x3gx7y-glibc-2.33-50/lib/libnss_files.so.2", O_RDONLY|O_CLOEXEC) = 3
08:36:47 read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\3202\0\0\0\0\0\0"..., 832) = 832
08:36:47 newfstatat(3, "", {st_mode=S_IFREG|0555, st_size=56000, ...}, AT_EMPTY_PATH) = 0
View datasets.nix
{pkgs ? import <nixpkgs>{}, python37Packages, tensorflow }:
with pkgs;
with pkgs.python37.pkgs;
let
includes_joined = symlinkJoin {
name = "tensorflow-metadata-deps";
paths = [ protobuf ];
};
tensorflow-metadata-bazel =
pkgs.buildBazelPackage rec {
View media-server-go-native.nix
{ pkgs ? import <nixpkgs>{} }:
let
src = pkgs.fetchgit {
fetchSubmodules = true;
url = "https://github.com/notedit/media-server-go-native.git";
deepClone = true;
rev = "4b84572c5b39f08e4dfaa44f0fe9e0c0f6b73e63";
sha256 = "sha256-+vrlixx8Z5RlKeafvBER7CClmMPNdEag3EFoeyWgTrs=";
};
in
View example.go
package main
import "C"
import (
"fmt"
"net/http"
"os"
"github.com/gin-contrib/static"
View gist:e86ba3937ed15f919b12d4cc30710f1b
// Copyright 2017 Michal Witkowski. All Rights Reserved.
// See LICENSE for licensing terms.
// Modified Thomas Bereknyei
package main
import (
"crypto/tls"
"crypto/x509"
"fmt"
View docker-override.nix
buildImageWithNixDb = args@{ contents ? null, extraCommands ? "", fromImage ? null, ... }:
let
# Use lazy evaluation to get list
contentsList = image.contentsList;
image = buildImage (args // {
config = args.config // {
Entrypoint = if args.config?Entrypoint then args.config.Entrypoint else "${entrypoint}/bin/entry";
Env = args.config.Env ++ [
"HOME=/root"
"USER=root"
View docker-helper.nix
{ pkgs ? import <nixpkgs> {}
}:
let
nix = pkgs.nixUnstable;
inherit (pkgs) stdenv;
# TODO: config could be using nixos modules
defaultConfig = {
Env = [
View catar.ksy
meta:
id: catar
file-extension: catar
endian: le
license: CC0-1.0
seq:
- id: top
type: ca_format
instances:
marker:
View catar.ksy
meta:
id: catar
file-extension: catar
endian: le
license: CC0-1.0
seq:
- id: header
type: ca_format
repeat: eos
types: