{ config, lib, pkgs, ... }: let domain = "kennys.mom"; headplanePort = 3000; cookieSecret = "iQ0bUyaFgwaijWaSyZ1ILA9RwfywrbZ3"; # Generate YAML config for headplane yamlData = { server = { host = "0.0.0.0"; port = headplanePort; cookie_secret = cookieSecret; cookie_secure = false; }; headscale = { url = "https://headscale.${domain}"; config_path = "/var/lib/headscale/config.yaml"; config_strict = true; }; integration = { proc = { enabled = true; }; }; }; yamlFormat = pkgs.formats.yaml { }; configFile = yamlFormat.generate "headplane.yaml" yamlData; headplanePkg = pkgs.stdenv.mkDerivation { pname = "headplane"; version = "0.5.10"; src = pkgs.fetchFromGitHub { owner = "tale"; repo = "headplane"; rev = "0.5.10"; sha256 = "sha256-Nx4rqH/dV/jg7txvXa40malRPYBeKE+ifd1pUswq/Gg="; }; buildInputs = [ pkgs.nodejs_22 (pkgs.yarn.override { nodejs = pkgs.nodejs_22; }) ]; installPhase = '' export HOME=$PWD export PATH=${pkgs.nodejs_22}/bin:$PATH yarn install --ignore-engines --frozen-lockfile || yarn install --ignore-engines --network-concurrency 1 --frozen-lockfile yarn build mkdir -p $out/share/headplane cp -r build/* $out/share/headplane/ mkdir -p $out/bin cat > $out/bin/headplane <