Skip to content

Instantly share code, notes, and snippets.

💲
nixified

zimbatm zimbatm

💲
nixified
Block or report user

Report or block zimbatm

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View new-loop.sh
#!/usr/bin/env bash
i=1
loop() {
echo "iteration $i"
((i++))
sleep 1
echo loop >> "$0"
}
loop
View env.toml
name = "etherbrowser"
packages = [
# generic tooling
"file",
"gitAndTools.git",
"gitAndTools.git-crypt",
"gnugrep",
"goreman",
"reflex",
View nix-profile.sh
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"
View use_nix_fast.sh
# 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
@zimbatm
zimbatm / sources.nix
Last active Jan 5, 2020
niv's source.nix but that's loading the flake.lock
View sources.nix
# Flake-lock source reader
with builtins;
let
readJSON = f: fromJSON (readFile f);
flakeLock = readJSON ../flake.lock;
fetchers = {
"github" = xxx: narHash:
let
View mkProfile.nix
{ lib
, bashInteractive
, buildEnv
, writeText
}:
{ name ? "profile"
, packages ? {}
, env ? {}
, profile ? ""
View mkBakeRoot.nix
{ pkgs }@orig:
{ pkgs ? orig.pkgs, rootDir }:
with builtins;
let
mapAttrsMerge = pred: set:
let
mapF = name:
let
v = pred name set.${name};
in
@zimbatm
zimbatm / default.nix
Last active Dec 20, 2019
$ alpacasay
View default.nix
{ cowsay, writeScriptBin }:
# When squinting, the alpaca looks a lot like a llama
writeScriptBin "alpacasay" ''
#!/bin/sh -e
${cowsay}/bin/cowsay -f ${./llama.cow} "$@"
''
View mkShellWithVSCode.nix
{ pkgs ? import <nixpkgs> {}
}:
with pkgs;
let
les = [
{
name = "csharp";
publisher = "ms-vscode";
version = "1.21.5";
View Dockerfile-traces
FROM golang:1.13.1 as builder
RUN mkdir -p /module
COPY go.mod /module/
COPY go.sum /module/
WORKDIR /module
RUN go mod download
COPY go /module/go/
WORKDIR /module/go/cmd/traces
RUN CGO_ENABLED=0 go build -o /traces .
You can’t perform that action at this time.