export KUBECONFIG=~/.kube/config
mkdir ~/.kube 2> /dev/null
sudo k3s kubectl config view --raw > "$KUBECONFIG"
chmod 600 "$KUBECONFIG"
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
{ | |
description = "Application packaged using poetry2nix"; | |
inputs.flake-utils.url = "github:numtide/flake-utils"; | |
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; | |
inputs.poetry2nix = { | |
url = "github:nix-community/poetry2nix"; | |
inputs.nixpkgs.follows = "nixpkgs"; | |
}; |
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
import zipfile | |
import io | |
zip_buffer = io.BytesIO() | |
with zipfile.ZipFile(zip_buffer, mode='w', compression=zipfile.ZIP_DEFLATED) as zipf: | |
zipf.writestr("file1.txt", "one") | |
zipf.writestr("file2.txt", "two") | |
zipf.writestr("file3.txt", "three") | |
zip_buffer.seek(0) |
Docker in Docker (dind) and overlay2 doesn't currently work on ZFS, so we need to create an ext4 filesystem volume and have Docker use that. This is helpful to anything that requires overlay2 and/or dind such as minikube (with Docker driver), or K3s.
sudo zfs create -s -V 100G rpool/docker
sudo mkfs.ext4 /dev/rpool/docker
$ curl -sfL https://get.k3s.io | sh -
[INFO] Finding release for channel stable
[INFO] Using v1.25.7+k3s1 as release
[INFO] Downloading hash https://github.com/k3s-io/k3s/releases/download/v1.25.7+k3s1/sha256sum-amd64.txt
[INFO] Downloading binary https://github.com/k3s-io/k3s/releases/download/v1.25.7+k3s1/k3s
[INFO] Verifying binary download
[INFO] Installing k3s to /usr/local/bin/k3s
[INFO] Skipping installation of SELinux RPM
[INFO] Creating /usr/local/bin/kubectl symlink to k3s
Install Ubuntu Desktop 22.04, encrypted ZFS, with minimal packages.
We may want to do the rest of the installation/configuration from our laptop over ssh, so:
Various configuration/data-templating languages:
- Jsonnet: https://jsonnet.org/
- UCL: https://github.com/vstakhov/libucl
- Nix: https://nixos.wiki/wiki/Nix_Expression_Language
- Coil: https://code.google.com/archive/p/coil/
- Pystachio: https://github.com/wickman/pystachio
- Cue: https://github.com/cuelang/cue
- GCL: Paper http://alexandria.tue.nl/extra1/afstversl/wsk-i/bokharouss2008.pdf
- UCG (a descendant of GCL) https://github.com/zaphar/ucg
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 | |
base_image='registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10' | |
tag='9e4c540d9e4972a36291dfdf81f079f37d748890' | |
image="${base_image}:${tag}" | |
docker run -it --rm \ | |
--volume /nix:/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
{-# language DataKinds #-} | |
{-# language DuplicateRecordFields #-} | |
{-# language OverloadedRecordDot #-} | |
import GHC.Records | |
data Person = Person | |
{ name :: String | |
, pet :: Pet | |
, partner :: Maybe Person |