Compare commits

...

16 Commits

Author SHA1 Message Date
b63abca296 Add MAILGUN_URL for EU region
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 22:29:08 +00:00
1311aadffb Remove phaseflow-cron batch job
No longer needed - cron scheduling now handled by instrumentation.ts
inside the main phaseflow app.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 22:16:20 +00:00
f903ddeee5 Update phaseflow secrets for Mailgun email provider
Switch from resend_api_key to mailgun_api_key and mailgun_domain.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 19:37:45 +00:00
33f3ddd7e9 Update flake. 2026-01-20 18:17:22 +00:00
1cdedf824c Meta and more RAM. Still not working. 2026-01-20 18:17:11 +00:00
beb856714e Install beads. 2026-01-18 07:34:15 +00:00
fcb2067059 Sync later in the mornings. 2026-01-17 16:28:20 +00:00
cebd236b1f Update flake. 2026-01-16 12:46:13 +00:00
8cc818f6b2 Rename deprecated options. 2026-01-16 10:54:09 +00:00
305a7a5115 Remove unknown option. 2026-01-16 10:41:29 +00:00
526888cd26 Improve phaseflow-cron logging on failure
Show the API response body in logs instead of silently failing
with curl exit code 22.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-15 07:40:28 +00:00
8d97d09b07 Add phaseflow-cron job and PocketBase admin credentials
- New periodic job for daily Garmin sync at 6 AM
- Added pocketbase_admin_email and pocketbase_admin_password to
  secrets template for cron job authentication

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-15 07:13:36 +00:00
3f481e0a16 Set the right vars. 2026-01-11 21:22:11 +00:00
15dea7a249 Make PocketBase admin UI accessible. 2026-01-11 17:22:42 +00:00
e1bace9044 Fix phaseflow PocketBase URL to use Nomad address
Docker containers in Nomad don't share network namespace by default.
Use NOMAD_ADDR_pocketbase interpolation instead of localhost.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-11 17:06:40 +00:00
09f2d2b013 More RAM. 2026-01-11 13:12:09 +00:00
8 changed files with 92 additions and 69 deletions

102
flake.lock generated
View File

@@ -25,11 +25,11 @@
"systems": "systems" "systems": "systems"
}, },
"locked": { "locked": {
"lastModified": 1767987169, "lastModified": 1768591869,
"narHash": "sha256-HRydj8HYesU+zGVf+g+tS9vTHMZpZU+MgnTjq8AYYXk=", "narHash": "sha256-Tph/rfG5Oebz1VQJiJXHMQEFpzXYV98d5fRkmepQK3Y=",
"owner": "nix-community", "owner": "nix-community",
"repo": "browser-previews", "repo": "browser-previews",
"rev": "2e9b12d065f95b4c670316baa572376e5d9a8d32", "rev": "46e6d0179b14a83401120a4481d170582e8f35f4",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -88,11 +88,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1766150702, "lastModified": 1768923567,
"narHash": "sha256-P0kM+5o+DKnB6raXgFEk3azw8Wqg5FL6wyl9jD+G5a4=", "narHash": "sha256-GVJ0jKsyXLuBzRMXCDY6D5J8wVdwP1DuQmmvYL/Vw/Q=",
"owner": "nix-community", "owner": "nix-community",
"repo": "disko", "repo": "disko",
"rev": "916506443ecd0d0b4a0f4cf9d40a3c22ce39b378", "rev": "00395d188e3594a1507f214a2f15d4ce5c07cb28",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -115,11 +115,11 @@
"treefmt-nix": "treefmt-nix" "treefmt-nix": "treefmt-nix"
}, },
"locked": { "locked": {
"lastModified": 1767776044, "lastModified": 1768914064,
"narHash": "sha256-yNLLrf4qKubvO11vTH6FjfPV2iCcNusivuzngEEuc+w=", "narHash": "sha256-MbRHoA4AWpDYebuGAAWtw/3UB11TZK195m1Vh7IIMkg=",
"owner": "nix-community", "owner": "nix-community",
"repo": "ethereum.nix", "repo": "ethereum.nix",
"rev": "34217e7d20d6ed04170a1347db346df068669090", "rev": "f254a491fa97bc45d7ccb36547314f6cf57f7b70",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -149,11 +149,11 @@
"nixpkgs-lib": "nixpkgs-lib" "nixpkgs-lib": "nixpkgs-lib"
}, },
"locked": { "locked": {
"lastModified": 1763759067, "lastModified": 1768135262,
"narHash": "sha256-LlLt2Jo/gMNYAwOgdRQBrsRoOz7BPRkzvNaI/fzXi2Q=", "narHash": "sha256-PVvu7OqHBGWN16zSi6tEmPwwHQ4rLPU9Plvs8/1TUBY=",
"owner": "hercules-ci", "owner": "hercules-ci",
"repo": "flake-parts", "repo": "flake-parts",
"rev": "2cccadc7357c0ba201788ae99c4dfa90728ef5e0", "rev": "80daad04eddbbf5a4d883996a73f3f542fa437ac",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -237,11 +237,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1764753179, "lastModified": 1767517855,
"narHash": "sha256-2u7C/aKEcCpND60JfREYhKaMg/0cZ/pk1HviizWrCl8=", "narHash": "sha256-LnZosb07bahYAyFw07JFzSXslx9j1dCe+npWDZdPFZg=",
"owner": "shazow", "owner": "shazow",
"repo": "foundry.nix", "repo": "foundry.nix",
"rev": "8c21d3ac7a03da27af55d3c94fe95620c9d6f316", "rev": "ee376e8a93f537c2865dda9811e748e4567a7aaf",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -258,11 +258,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1767910483, "lastModified": 1768603898,
"narHash": "sha256-MOU5YdVu4DVwuT5ztXgQpPuRRBjSjUGIdUzOQr9iQOY=", "narHash": "sha256-vRV1dWJOCpCal3PRr86wE2WTOMfAhTu6G7bSvOsryUo=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "82fb7dedaad83e5e279127a38ef410bcfac6d77c", "rev": "2a63d0e9d2c72ac4d4150ebb242cf8d86f488c8c",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -280,11 +280,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1747978958, "lastModified": 1768598210,
"narHash": "sha256-pQQnbxWpY3IiZqgelXHIe/OAE/Yv4NSQq7fch7M6nXQ=", "narHash": "sha256-kkgA32s/f4jaa4UG+2f8C225Qvclxnqs76mf8zvTVPg=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "7419250703fd5eb50e99bdfb07a86671939103ea", "rev": "c47b2cc64a629f8e075de52e4742de688f930dc6",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -299,11 +299,11 @@
"nixpkgs": "nixpkgs" "nixpkgs": "nixpkgs"
}, },
"locked": { "locked": {
"lastModified": 1767822991, "lastModified": 1768835187,
"narHash": "sha256-iyrn9AcPZCoyxX4OT8eMkBsjG7SRUQXXS/V1JzxS7rA=", "narHash": "sha256-6nY0ixjGjPQCL+/sUC1B1MRiO1LOI3AkRSIywm3i3bE=",
"owner": "nix-community", "owner": "nix-community",
"repo": "impermanence", "repo": "impermanence",
"rev": "82e5bc4508cab9e8d5a136626276eb5bbce5e9c5", "rev": "0d633a69480bb3a3e2f18c080d34a8fa81da6395",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -353,11 +353,11 @@
}, },
"nixos-hardware": { "nixos-hardware": {
"locked": { "locked": {
"lastModified": 1767185284, "lastModified": 1768736227,
"narHash": "sha256-ljDBUDpD1Cg5n3mJI81Hz5qeZAwCGxon4kQW3Ho3+6Q=", "narHash": "sha256-qgGq7CfrYKc3IBYQ7qp0Z/ZXndQVC5Bj0N8HW9mS2rM=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixos-hardware", "repo": "nixos-hardware",
"rev": "40b1a28dce561bea34858287fbb23052c3ee63fe", "rev": "d447553bcbc6a178618d37e61648b19e744370df",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -369,11 +369,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1748026106, "lastModified": 1768564909,
"narHash": "sha256-6m1Y3/4pVw1RWTsrkAK2VMYSzG4MMIj7sqUy7o8th1o=", "narHash": "sha256-Kell/SpJYVkHWMvnhqJz/8DqQg2b6PguxVWOuadbHCc=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "063f43f2dbdef86376cc29ad646c45c46e93234c", "rev": "e4bae1bd10c9c57b2cf517953ab70060a828ee6f",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -385,11 +385,11 @@
}, },
"nixpkgs-lib": { "nixpkgs-lib": {
"locked": { "locked": {
"lastModified": 1761765539, "lastModified": 1765674936,
"narHash": "sha256-b0yj6kfvO8ApcSE+QmA6mUfu8IYG6/uU28OFn4PaC8M=", "narHash": "sha256-k00uTP4JNfmejrCLJOwdObYC9jHRrr/5M/a/8L2EIdo=",
"owner": "nix-community", "owner": "nix-community",
"repo": "nixpkgs.lib", "repo": "nixpkgs.lib",
"rev": "719359f4562934ae99f5443f20aa06c2ffff91fc", "rev": "2075416fcb47225d9b68ac469a5c4801a9c4dd85",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -415,11 +415,11 @@
}, },
"nixpkgs-unstable": { "nixpkgs-unstable": {
"locked": { "locked": {
"lastModified": 1765270179, "lastModified": 1768456270,
"narHash": "sha256-g2a4MhRKu4ymR4xwo+I+auTknXt/+j37Lnf0Mvfl1rE=", "narHash": "sha256-NgaL2CCiUR6nsqUIY4yxkzz07iQUlUCany44CFv+OxY=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "677fbe97984e7af3175b6c121f3c39ee5c8d62c9", "rev": "f4606b01b39e09065df37905a2133905246db9ed",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -431,11 +431,11 @@
}, },
"nixpkgs-unstable_2": { "nixpkgs-unstable_2": {
"locked": { "locked": {
"lastModified": 1767892417, "lastModified": 1768564909,
"narHash": "sha256-dhhvQY67aboBk8b0/u0XB6vwHdgbROZT3fJAjyNh5Ww=", "narHash": "sha256-Kell/SpJYVkHWMvnhqJz/8DqQg2b6PguxVWOuadbHCc=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "3497aa5c9457a9d88d71fa93a4a8368816fbeeba", "rev": "e4bae1bd10c9c57b2cf517953ab70060a828ee6f",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -447,11 +447,11 @@
}, },
"nixpkgs_2": { "nixpkgs_2": {
"locked": { "locked": {
"lastModified": 1767799921, "lastModified": 1768773494,
"narHash": "sha256-r4GVX+FToWVE2My8VVZH4V0pTIpnu2ZE8/Z4uxGEMBE=", "narHash": "sha256-XsM7GP3jHlephymxhDE+/TKKO1Q16phz/vQiLBGhpF4=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "d351d0653aeb7877273920cd3e823994e7579b0b", "rev": "77ef7a29d276c6d8303aece3444d61118ef71ac2",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -470,11 +470,11 @@
"systems": "systems_4" "systems": "systems_4"
}, },
"locked": { "locked": {
"lastModified": 1767906546, "lastModified": 1768910181,
"narHash": "sha256-AoSWS8+P+7hQ/jIdv0wBjgH1MvnerdWBFXO4GV3JoQs=", "narHash": "sha256-YRU0IHMzXluZxr0JDfq9jtblb4DV7MIB5wj2jYMFKQc=",
"owner": "nix-community", "owner": "nix-community",
"repo": "nixvim", "repo": "nixvim",
"rev": "7eb8f36f085b85a2aeff929aff52d0f6aa14e000", "rev": "5b138edcb2f1c3ed4b29eca3658f04f0639b98b3",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -507,11 +507,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1768032389, "lastModified": 1768863606,
"narHash": "sha256-BVpTd93G0XmAK1iXiBdhUA5Uvt+WmM1YL0mA4REcT68=", "narHash": "sha256-1IHAeS8WtBiEo5XiyJBHOXMzECD6aaIOJmpQKzRRl64=",
"owner": "Mic92", "owner": "Mic92",
"repo": "sops-nix", "repo": "sops-nix",
"rev": "a8cfe238b93166f9f96c0df67a94e572554ee624", "rev": "c7067be8db2c09ab1884de67ef6c4f693973f4a2",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -588,11 +588,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1766000401, "lastModified": 1768158989,
"narHash": "sha256-+cqN4PJz9y0JQXfAK5J1drd0U05D5fcAGhzhfVrDlsI=", "narHash": "sha256-67vyT1+xClLldnumAzCTBvU0jLZ1YBcf4vANRWP3+Ak=",
"owner": "numtide", "owner": "numtide",
"repo": "treefmt-nix", "repo": "treefmt-nix",
"rev": "42d96e75aa56a3f70cab7e7dc4a32868db28e8fd", "rev": "e96d59dff5c0d7fddb9d113ba108f03c3ef99eca",
"type": "github" "type": "github"
}, },
"original": { "original": {

View File

@@ -58,13 +58,13 @@
overlay-unstable = final: prev: { overlay-unstable = final: prev: {
unstable = import nixpkgs-unstable { unstable = import nixpkgs-unstable {
inherit (prev) system; system = prev.stdenv.hostPlatform.system;
config.allowUnfree = true; config.allowUnfree = true;
}; };
}; };
overlay-browser-previews = final: prev: { overlay-browser-previews = final: prev: {
browser-previews = browser-previews.packages.${prev.system}; browser-previews = browser-previews.packages.${prev.stdenv.hostPlatform.system};
}; };
mkHost = mkHost =

View File

@@ -5,6 +5,7 @@ let
cliPkgs = with pkgs; [ cliPkgs = with pkgs; [
ast-grep ast-grep
yq yq
unstable.beads
unstable.claude-code unstable.claude-code
unstable.codex unstable.codex
unstable.gemini-cli unstable.gemini-cli

View File

@@ -15,9 +15,5 @@
natural_scroll = false; natural_scroll = false;
}; };
}; };
gestures = lib.mkDefault {
workspace_swipe = false;
};
}; };
} }

View File

@@ -347,8 +347,12 @@
git = { git = {
enable = true; enable = true;
userEmail = "petru@paler.net"; settings = {
userName = "Petru Paler"; user = {
email = "petru@paler.net";
name = "Petru Paler";
};
};
}; };
home-manager = { home-manager = {

View File

@@ -4,9 +4,12 @@
# Setup required before running: # Setup required before running:
# sudo mkdir -p /data/services/phaseflow/pb_data && sudo chown 1000:1000 /data/services/phaseflow /data/services/phaseflow/pb_data # sudo mkdir -p /data/services/phaseflow/pb_data && sudo chown 1000:1000 /data/services/phaseflow /data/services/phaseflow/pb_data
# nomad var put secrets/phaseflow \ # nomad var put secrets/phaseflow \
# resend_api_key="re_xxxx" \ # mailgun_api_key="key-xxxx" \
# mailgun_domain="paler.net" \
# encryption_key="$(openssl rand -hex 16)" \ # encryption_key="$(openssl rand -hex 16)" \
# cron_secret="$(openssl rand -hex 32)" # cron_secret="$(openssl rand -hex 32)" \
# pocketbase_admin_email="admin@example.com" \
# pocketbase_admin_password="your-admin-password"
job "phaseflow" { job "phaseflow" {
datacenters = ["alo"] datacenters = ["alo"]
@@ -58,6 +61,16 @@ job "phaseflow" {
resources { resources {
memory = 256 memory = 256
} }
service {
name = "pocketbase-phaseflow"
port = "pocketbase"
tags = [
"traefik.enable=true",
"traefik.http.routers.pocketbase-phaseflow.entryPoints=websecure",
]
}
} }
# Main Next.js application # Main Next.js application
@@ -73,9 +86,11 @@ job "phaseflow" {
env { env {
NODE_ENV = "production" NODE_ENV = "production"
POCKETBASE_URL = "http://localhost:8090" POCKETBASE_URL = "http://${NOMAD_ADDR_pocketbase}"
NEXT_PUBLIC_POCKETBASE_URL = "https://pocketbase-phaseflow.v.paler.net"
APP_URL = "https://phaseflow.v.paler.net" APP_URL = "https://phaseflow.v.paler.net"
EMAIL_FROM = "phaseflow@paler.net" EMAIL_FROM = "phaseflow@paler.net"
MAILGUN_URL = "https://api.eu.mailgun.net"
} }
# Secrets from Nomad variables # Secrets from Nomad variables
@@ -83,9 +98,12 @@ job "phaseflow" {
destination = "secrets/env.env" destination = "secrets/env.env"
env = true env = true
data = <<EOH data = <<EOH
RESEND_API_KEY={{ with nomadVar "secrets/phaseflow" }}{{ .resend_api_key }}{{ end }} MAILGUN_API_KEY={{ with nomadVar "secrets/phaseflow" }}{{ .mailgun_api_key }}{{ end }}
MAILGUN_DOMAIN={{ with nomadVar "secrets/phaseflow" }}{{ .mailgun_domain }}{{ end }}
ENCRYPTION_KEY={{ with nomadVar "secrets/phaseflow" }}{{ .encryption_key }}{{ end }} ENCRYPTION_KEY={{ with nomadVar "secrets/phaseflow" }}{{ .encryption_key }}{{ end }}
CRON_SECRET={{ with nomadVar "secrets/phaseflow" }}{{ .cron_secret }}{{ end }} CRON_SECRET={{ with nomadVar "secrets/phaseflow" }}{{ .cron_secret }}{{ end }}
POCKETBASE_ADMIN_EMAIL={{ with nomadVar "secrets/phaseflow" }}{{ .pocketbase_admin_email }}{{ end }}
POCKETBASE_ADMIN_PASSWORD={{ with nomadVar "secrets/phaseflow" }}{{ .pocketbase_admin_password }}{{ end }}
EOH EOH
} }

View File

@@ -4,6 +4,10 @@
job "urbit" { job "urbit" {
datacenters = ["alo"] datacenters = ["alo"]
meta {
uuid = uuidv4()
}
group "os" { group "os" {
network { network {
port "http" { port "http" {
@@ -25,7 +29,7 @@ job "urbit" {
# You can also set a variable loom size (Urbit memory size) using # You can also set a variable loom size (Urbit memory size) using
# --loom=$LOOM_SIZE. Passing /bin/start-urbit --loom=32 for example, would set up # --loom=$LOOM_SIZE. Passing /bin/start-urbit --loom=32 for example, would set up
# a 4GiB loom (2^32 bytes = 4GiB). The default loom size is 31 (2GiB). # a 4GiB loom (2^32 bytes = 4GiB). The default loom size is 31 (2GiB).
"--loom=31", "--loom=32",
] ]
volumes = [ volumes = [
"/data/services/urbit:/urbit", "/data/services/urbit:/urbit",
@@ -45,7 +49,7 @@ job "urbit" {
resources { resources {
# dependent on --loom setting + some buffer # dependent on --loom setting + some buffer
memory = 2100 memory = 4200
} }
} }
} }

View File

@@ -29,7 +29,7 @@ job "weewx" {
} }
resources { resources {
memory = 1024 memory = 1500
} }
} }