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 | |
# From Gerrit Code Review 3.0.1 | |
# | |
# Part of Gerrit Code Review (https://www.gerritcodereview.com/) | |
# | |
# Copyright (C) 2009 The Android Open Source Project | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at |
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 bash | |
set -euo pipefail | |
target_host=root@35.236.126.176 | |
target_port=10022 | |
export NIX_PATH=nixpkgs=/home/zimbatm/go/src/github.com/NixOS/nixpkgs | |
export NIX_SSHOPTS="-p $target_port" | |
export TERM=xterm |
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 bash | |
i=1 | |
loop() { | |
echo "iteration $i" | |
((i++)) | |
sleep 1 | |
echo loop >> "$0" | |
} | |
loop |
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
name = "etherbrowser" | |
packages = [ | |
# generic tooling | |
"file", | |
"gitAndTools.git", | |
"gitAndTools.git-crypt", | |
"gnugrep", | |
"goreman", | |
"reflex", |
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
nix-profile() { | |
local profile=$PWD/.direnv/nix-profile | |
mkdir -p .direnv | |
rm -f "$profile" | |
nix-build --out-link "$profile" profile.nix | |
watch_file profile.nix | |
#source "$profile/etc/profile.d/nix.sh" | |
load_prefix "$profile" |
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
# Usage: use nix_shell | |
# | |
# Works like use_nix, except that it's only rebuilt if the shell.nix or | |
# default.nix file changes. This avoids scenarios where the nix-channel is | |
# being updated and all the projects now need to be re-built. | |
# | |
# To force the reload the derivation, run `touch shell.nix` | |
use_nix() { | |
local shellfile=shell.nix | |
local wd=$PWD/.direnv/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
# Flake-lock source reader | |
with builtins; | |
let | |
readJSON = f: fromJSON (readFile f); | |
flakeLock = readJSON ../flake.lock; | |
fetchers = { | |
"github" = xxx: narHash: | |
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
{ lib | |
, bashInteractive | |
, buildEnv | |
, writeText | |
}: | |
{ name ? "profile" | |
, packages ? {} | |
, env ? {} | |
, profile ? "" |
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 }@orig: | |
{ pkgs ? orig.pkgs, rootDir }: | |
with builtins; | |
let | |
mapAttrsMerge = pred: set: | |
let | |
mapF = name: | |
let | |
v = pred name set.${name}; | |
in |
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
{ cowsay, writeScriptBin }: | |
# When squinting, the alpaca looks a lot like a llama | |
writeScriptBin "alpacasay" '' | |
#!/bin/sh -e | |
${cowsay}/bin/cowsay -f ${./llama.cow} "$@" | |
'' |