Skip to content

Instantly share code, notes, and snippets.

View shift's full-sized avatar

Vincent Palmer shift

View GitHub Profile
@shift
shift / flake.nix
Created February 1, 2024 11:45
esp flake.nix/shell.nix
{
description = "shift's esphome-devices.";
inputs.flake-utils.url = "github:numtide/flake-utils";
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem
(system:
let pkgs = nixpkgs.legacyPackages.${system}; in
{
# Flake sops-nix
https://github.com/Mic92/sops-nix#usage-example explains how to setup the keys in the `.sops.yaml` file.
If using JSON add the following step below, if YAML, you can already nest things and goto adding the module.
Add
```
sops-nix.url = "github:juspay/sops-nix/json-nested"; # https://github.com/Mic92/sops-nix/pull/328
```
To your inputs.
@shift
shift / knot-odhcpd-dynamic-updates.sh
Last active April 6, 2024 09:20
Enables knotd+kresd to serve as a replacement for DNSmasq and still retain the dynamic DNS updates from DHCPv4 & DHCPv6 leases.
#!/bin/sh
# Configuration
lease_file='/tmp/hosts/odhcpd'
forward_zone='ber.section.me.'
reverse_zone_ipv4='1.168.192.in-addr.arpa.'
reverse_zone_ipv6='f.d.0.5.0.7.4.0.1.0.0.2.ip6.arpa.'
# Function for code reusability and readability
expand_ipv6() {