feat: rewrite pi to be simple and nix based

This commit is contained in:
Jet Pham 2026-03-08 19:06:08 -07:00
parent b2c8d08bdc
commit c6e726c430
No known key found for this signature in database
28 changed files with 880 additions and 2458 deletions

39
pi/configuration.nix Normal file
View file

@ -0,0 +1,39 @@
{ config, pkgs, ... }:
{
system.stateVersion = "24.11";
networking.hostName = "noisebell";
# Enable the noisebell service
services.noisebell = {
enable = true;
endpointUrl = "https://example.com/webhook"; # TODO: set your endpoint
};
# Basic system config
nix.settings.experimental-features = [ "nix-command" "flakes" ];
# Tailscale
services.tailscale.enable = true;
# Caddy reverse proxy — proxies to the noisebell status endpoint
services.caddy = {
enable = true;
virtualHosts.":80".extraConfig = ''
reverse_proxy localhost:${toString config.services.noisebell.port}
'';
};
services.openssh.enable = true;
# Only allow traffic from Tailscale interface
networking.firewall = {
trustedInterfaces = [ "tailscale0" ];
allowedUDPPorts = [ config.services.tailscale.port ];
};
users.users.root.openssh.authorizedKeys.keys = [
# TODO: add your SSH public key
];
}