Skip to content

Instantly share code, notes, and snippets.

View elseym's full-sized avatar

Simon Waibl elseym

  • Mayflower GmbH
  • Munich
View GitHub Profile
@elseym
elseym / netboot.xyz
Last active September 2, 2021 16:21
openwrt stuff
#!/bin/ash
while [ $# -gt 0 ]; do case "${1}" in
-f|--force) force="y";;
-r|--renew|--redownload) renew="y";;
-d|--destination) shift; dest_dir="${1}";;
-i|--dnsmasq_instance) shift; dnsmasq_instance="${1}";;
-t|--types|--imagetypes|--images) shift; images="${1}";;
esac; shift; done
@elseym
elseym / init.sh
Created June 19, 2021 12:36
nixos on zfs with efi boot and full disk encryption
#!/usr/bin/env bash
set -euo pipefail
# this can be your hostname
name=nixos
disk=/dev/nvme0n1
# destroy disk / remove signatures
zpool destroy -f $name ||:
wipefs -f -a "$disk"* ||:
@elseym
elseym / module.nix
Created May 28, 2021 12:57
kotenpflaumen
{ config, pkgs, lib, unstable, ... }:
with lib;
let
cfg = config.pflaumen.dns.server;
fmt = pkgs.formats.knotConf {};
overlay = _: flip recursiveUpdate { inherit formats; };
formats.knotConf = {}: rec {
@elseym
elseym / porkbun.nix.sh
Created April 17, 2021 14:54
Porkbun Domain Price List
#! /usr/bin/env nix-shell
#! nix-shell -i bash -p curl jq pup utillinux
declare -x PB_YEARS=${PB_YEARS:-5}
declare -x PB_LIMIT=${PB_LIMIT:-23}
echo "Loading the $PB_LIMIT cheapest (over $PB_YEARS years) TLDs from porkbun.com..."
echo; (
cat .pbcache.json 2>/dev/null ||
curl -ksSLo- 'https://porkbun.com/products/domains'
@elseym
elseym / configuration.nix.tpl
Last active April 10, 2021 19:16
nixos.party
{
imports = [ <nixpkgs/nixos/modules/profiles/qemu-guest.nix> ];
boot.loader.grub.devices = [ "$nixosparty_disk" ];
fileSystems."/".label = "root";
swapDevices = [ { label = "swap"; } ];
networking.hostName = "$nixosparty_name";
services.openssh.enable = true;
users.users."root" = {
password = "$nixosparty_password";
openssh.authorizedKeys.keys = [ $nixosparty_authorized_keys ];