This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ 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} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set -eu | |
# copy post-build-hook script to /etc/nix | |
cp ./upload-to-cache.sh /etc/nix/ | |
chmod a+x /etc/nix/upload-to-cache.sh | |
# fetch the secret key used to access the S3 cache bucket from the | |
# environment, and write to disk (it is used to by the |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#[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 { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extern crate errno; | |
extern crate libc; | |
extern crate ascii; | |
use std::ffi::{CStr, CString}; | |
use ascii::AsciiStr; | |
#[repr(C)] | |
pub struct Stralloc_C { | |
s: *mut libc::c_char, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ pkgs }: | |
let | |
lib = pkgs.lib; | |
in | |
# list of additional packages to add to the packageset | |
additionalPackages: | |
# source path of the package (derivation or (filtered) nix path) | |
assert (lib.all (pkg: pkg ? src) additionalPackages); | |
# dhall file of that package |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
attrs: | |
let | |
nixpkgs = import "${attrs.nixpkgs}/pkgs/top-level/release.nix" attrs; | |
in { | |
inherit (nixpkgs) haskellPackages; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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. | |
let | |
pkgs = import <nixpkgs> {}; | |
repository-dir = toString ./.; | |
git-hook-dir = | |
let |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ pkgs ? import ./nixpkgs.nix {} }: | |
with pkgs.lib; | |
let | |
dhallFiles = ../src; | |
# convert dhall packages set to a nix file | |
spacchettiNix = pkgs.runCommand "spacchetti.nix" {} '' | |
${pkgs.dhall-nix}/bin/dhall-to-nix \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- TODO: loops, parameter handling, heredocs, string-munging | |
λ(markdownToHtml : Text → Text) | |
→ let Prelude = | |
./imports/Prelude/package.dhall | |
let el = | |
λ(bash : Text) | |
→ λ(execline : Text) | |
→ { bash = bash, execline = execline, note = None Text } |