Skip to content

Instantly share code, notes, and snippets.



View GitHub Profile
View service.nix
{ pkgs }:
{ service-dir }:
let sd = pkgs.lib.escapeShellArg service-dir;
in pkgs.writers.writeDash "service" ''
set -e
CMD=''${1:?please specify command as first argument}
#!/usr/bin/env python3
# Small wrapper around nix-instantiate and `nix-store --realize`
# that checks whether the output path is already in a cache
# and if it isn’t, builds it.
# The arguments you pass will be given to nix-instantiate,
# not to nix-store --realize
# (This might be a TODO for the future).
Profpatsch /
Created Jun 7, 2020
post-build-hooks in nix on circleci
set -eu
# copy post-build-hook script to /etc/nix
cp ./ /etc/nix/
chmod a+x /etc/nix/
# fetch the secret key used to access the S3 cache bucket from the
# environment, and write to disk (it is used to by the
#[derive(Clone, Debug, PartialEq, Eq,)]
struct Parsed<'a> {
protocol: Protocol,
domain: &'a str,
port: &'a str,
rest: &'a str,
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
enum Protocol {
Profpatsch /
Last active May 15, 2020
el_subsitute wrapper
extern crate errno;
extern crate libc;
extern crate ascii;
use std::ffi::{CStr, CString};
use ascii::AsciiStr;
pub struct Stralloc_C {
s: *mut libc::c_char,
View build-purescript-tmp.nix
{ pkgs }:
lib = pkgs.lib;
# list of additional packages to add to the packageset
# source path of the package (derivation or (filtered) nix path)
assert (lib.all (pkg: pkg ? src) additionalPackages);
# dhall file of that package
Profpatsch / release.nix
Last active May 28, 2020
haskell refactor hydra jobset
View release.nix
nixpkgs = import "${attrs.nixpkgs}/pkgs/top-level/release.nix" attrs;
in {
inherit (nixpkgs) haskellPackages;
Profpatsch / pass-shell.nix
Created Dec 13, 2019
shell.nix for a pass passwordstore (plus pre-commit hook to prevent leaking unencrypted secrets)
View pass-shell.nix
# sets up the environment in a way that adapts pass and git
# to work with the files in this repository instead of
# the global pass store.
pkgs = import <nixpkgs> {};
repository-dir = toString ./.;
git-hook-dir =
Profpatsch / spaccetthi.nix
Created Nov 18, 2019
Build purescript packages from spacchetthi definitions
View spaccetthi.nix
{ pkgs ? import ./nixpkgs.nix {} }:
with pkgs.lib;
dhallFiles = ../src;
# convert dhall packages set to a nix file
spacchettiNix = pkgs.runCommand "spacchetti.nix" {} ''
${pkgs.dhall-nix}/bin/dhall-to-nix \
View execline-table.dhall
-- TODO: loops, parameter handling, heredocs, string-munging
λ(markdownToHtml : Text Text)
let Prelude =
let el =
λ(bash : Text)
λ(execline : Text)
{ bash = bash, execline = execline, note = None Text }
You can’t perform that action at this time.