Skip to content

Instantly share code, notes, and snippets.

View adamcstephens's full-sized avatar
🍕
hello

Adam C. Stephens adamcstephens

🍕
hello
View GitHub Profile
#!/usr/bin/env nu
def main [--vm: bool = true, --container: bool = true] {
if ($vm) {
print ":: [virtual-machine] building image"
let paths = nix-build -A lxdVirtualMachineImageMeta.x86_64-linux -A lxdVirtualMachineImage.x86_64-linux ./nixos/release.nix | lines
print ":: [virtual-machine] importing image"
incus image import --alias nixos/unstable/virtual-machine ($paths.0 + /tarball/nixos-system-x86_64-linux.tar.xz) ($paths.1 + /nixos.qcow2)
}
#!/usr/bin/env nu
def main [interface: string, hostname: string, --icanhazip: bool, --provider: string = "desec" ] {
let link = (ip --json link show dev $interface | from json)
if (($link.operstate | first) == "DOWN") {
print "Link not up. Exiting quietly"
exit 0
}
let addresses = if ($icanhazip) {
@adamcstephens
adamcstephens / file.patch
Created August 4, 2023 19:35
nixos-remove-pkgs-eval-config
diff --git a/nixos/lib/eval-config.nix b/nixos/lib/eval-config.nix
index 81a5ea1750d..8346bb4a132 100644
--- a/nixos/lib/eval-config.nix
+++ b/nixos/lib/eval-config.nix
@@ -13,9 +13,6 @@ evalConfigArgs@
# however, removing or changing this default is too much
# of a breaking change. To set it modularly, pass `null`.
system ? builtins.currentSystem
-, # !!! is this argument needed any more? The pkgs argument can
- # be set modularly anyway.
{
config,
lib,
pkgs,
self',
...
}:
with lib; let
cfg = config.services.minidsp;
in {
diff --git a/Cargo.lock b/Cargo.lock
index 63ddf87..6176669 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -563,7 +563,7 @@ checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a"
[[package]]
name = "minidsp"
-version = "0.1.8"
+version = "0.1.9"
{
"__inputs": [
{
"name": "DS_PROMETHEUS",
"label": "Prometheus",
"description": "",
"type": "datasource",
"pluginId": "prometheus",
"pluginName": "Prometheus"
}
#!/usr/bin/env bash
#
# generate aqua-registry package from github release.
# requires: curl, jq, fzf
if [ -z $2 ]; then
echo "Usage: $0 <repo_owner> <repo_name>"
exit 2
fi
@adamcstephens
adamcstephens / docker-compose.yml
Last active May 7, 2021 15:50
Traefik, Wildcard Cert, Pomerium, Docker Compose
version: "3.3"
services:
proxy:
image: traefik:latest
command:
- --global.sendAnonymousUsage=false
- --log.level=WARN
- --api.insecure=true
- --api.dashboard=true
@adamcstephens
adamcstephens / Corefile
Created July 18, 2020 21:28
pi-hole and coredns, multi-provider TLS upstreams with failover, using docker compose
private {
auto {
directory /config/zones
}
}
. {
errors
log
prometheus
@adamcstephens
adamcstephens / Makefile
Last active July 9, 2019 14:57
backup files with make
files_dir := ./files
files = $(wildcard $(files_dir)/.[a-z]*)
all:
rsync -av $(files_dir)/ ${HOME}/
backup:
$(foreach file, $(files), rsync -av --delete ${HOME}/$(shell echo $(file) | sed "s/\.\/files\///") $(files_dir)/;)
.PHONY: all backup