diff --git a/flake.lock b/flake.lock index b398627..5dedc4d 100644 --- a/flake.lock +++ b/flake.lock @@ -61,6 +61,25 @@ "type": "github" } }, + "crosspost": { + "inputs": { + "nixpkgs": "nixpkgs" + }, + "locked": { + "lastModified": 1792943133, + "narHash": "sha256-qnrkRQksIVfzGhWGnhBSWd91sSb6NBy9qQ6SPMW0/Co=", + "ref": "main", + "rev": "c1abfb1370857bc069037e177be9d1b8539398ed", + "revCount": 3, + "type": "git", + "url": "ssh://git@github.com/thegeneralist01/crosspost" + }, + "original": { + "ref": "main", + "type": "git", + "url": "ssh://git@github.com/thegeneralist01/crosspost" + } + }, "fenix": { "inputs": { "nixpkgs": [ @@ -364,11 +383,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1774709303, - "narHash": "sha256-D3Q07BbIA2KnTcSXIqqu9P586uWxN74zNoCH3h2ESHg=", + "lastModified": 1792773339, + "narHash": "sha256-rZLrzrC6i+jnTAlvPZHogKDulY7WWDEv9hJeHieO7Zw=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "8110df5ad7abf5d4c0f6fb0f8f978390e77f9685", + "rev": "3ec636362e1816bc2f0888fa0fa2c69f1bc9e504", "type": "github" }, "original": { @@ -427,6 +446,22 @@ } }, "nixpkgs_2": { + "locked": { + "lastModified": 1774709303, + "narHash": "sha256-D3Q07BbIA2KnTcSXIqqu9P586uWxN74zNoCH3h2ESHg=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "8110df5ad7abf5d4c0f6fb0f8f978390e77f9685", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_3": { "locked": { "lastModified": 1755186698, "narHash": "sha256-wNO3+Ks2jZJ4nTHMuks+cxAiVBGNuEBXsT29Bz6HASo=", @@ -442,7 +477,7 @@ "type": "github" } }, - "nixpkgs_3": { + "nixpkgs_4": { "locked": { "lastModified": 1769789167, "narHash": "sha256-kKB3bqYJU5nzYeIROI82Ef9VtTbu4uA3YydSk/Bioa8=", @@ -506,7 +541,7 @@ "readlater-bot": { "inputs": { "flake-utils": "flake-utils_3", - "nixpkgs": "nixpkgs_3" + "nixpkgs": "nixpkgs_4" }, "locked": { "lastModified": 1776031277, @@ -526,6 +561,7 @@ "inputs": { "aerospace-src": "aerospace-src", "agenix": "agenix", + "crosspost": "crosspost", "fenix": "fenix", "ghostty": "ghostty", "helium": "helium", @@ -535,7 +571,7 @@ "niri": "niri", "nix-darwin": "nix-darwin", "nix-homebrew": "nix-homebrew", - "nixpkgs": "nixpkgs", + "nixpkgs": "nixpkgs_2", "noctalia": "noctalia", "noctalia-qs": "noctalia-qs", "readlater-bot": "readlater-bot", @@ -652,7 +688,7 @@ }, "treefmt-nix": { "inputs": { - "nixpkgs": "nixpkgs_2" + "nixpkgs": "nixpkgs_3" }, "locked": { "lastModified": 1772660329, diff --git a/flake.nix b/flake.nix index 381c498..1e039ae 100644 --- a/flake.nix +++ b/flake.nix @@ -64,6 +64,10 @@ url = "github:thegeneralist01/bookkeeper"; }; + # Private repo: git+ssh so fetching uses the evaluating user's SSH key (github: would need an access token). + # No nixpkgs follows: the worker is built from crosspost's own pinned nixpkgs. + crosspost.url = "git+ssh://git@github.com/thegeneralist01/crosspost?ref=main"; + noctalia = { url = "github:noctalia-dev/noctalia-shell"; inputs.nixpkgs.follows = "nixpkgs"; diff --git a/hosts/thegeneralist/configuration.nix b/hosts/thegeneralist/configuration.nix index 62aebe9..82113cc 100644 --- a/hosts/thegeneralist/configuration.nix +++ b/hosts/thegeneralist/configuration.nix @@ -17,6 +17,7 @@ ./cache ./archive ./forgejo + ./crosspost ]; age.secrets.readlaterBotToken = { diff --git a/hosts/thegeneralist/crosspost/api-token.age b/hosts/thegeneralist/crosspost/api-token.age new file mode 100644 index 0000000..ad6724c --- /dev/null +++ b/hosts/thegeneralist/crosspost/api-token.age @@ -0,0 +1,5 @@ +age-encryption.org/v1 +-> ssh-ed25519 pp9qdQ Dye18WG21VQ551B9FHTQ4h3LuMkHEtvhvdJlM1ITxF8 +QBg7sp1mGH/1MgXojf8YSQK0eWY+ZEllDiKsV9fvnRk +--- odTSmOaF35PJqMI9X2UbfXQr2E4r/wizVmEeKUwXDZg +$f£Û&qA]$æ"×Òá±Ûÿ¬¢"ùñÊ®á Ë´Öo³2ß/SÎë^T¯¶©¹`7zh .E5ŽšBç)‹ÎçyÀ¿˜üV„ã( \ No newline at end of file diff --git a/hosts/thegeneralist/crosspost/default.nix b/hosts/thegeneralist/crosspost/default.nix new file mode 100644 index 0000000..a2db76a --- /dev/null +++ b/hosts/thegeneralist/crosspost/default.nix @@ -0,0 +1,14 @@ +{ config, ... }: +{ + # Crosspost worker: publishes queued X/LinkedIn/Instagram posts for crosspost-app (Cloudflare). + # Outbound HTTPS only. Module source: ~/personal/crosspost (flake input `crosspost`). + age.secrets.crosspostApiToken.file = ./api-token.age; + age.secrets.crosspostWorkerKey.file = ./worker-key.age; + + services.crosspost = { + enable = true; + appUrl = "https://crosspost-app.thegeneralist01.workers.dev"; + apiTokenFile = config.age.secrets.crosspostApiToken.path; + privateKeyFile = config.age.secrets.crosspostWorkerKey.path; + }; +} diff --git a/hosts/thegeneralist/crosspost/worker-key.age b/hosts/thegeneralist/crosspost/worker-key.age new file mode 100644 index 0000000..23d19c8 Binary files /dev/null and b/hosts/thegeneralist/crosspost/worker-key.age differ diff --git a/secrets.nix b/secrets.nix index b71374b..1d63d0a 100644 --- a/secrets.nix +++ b/secrets.nix @@ -11,6 +11,8 @@ in "hosts/thegeneralist/readlater-bot-token.age".publicKeys = [ thegeneralist ]; "hosts/thegeneralist/readlater-bot-sync-token.age".publicKeys = [ thegeneralist ]; "hosts/thegeneralist/readlater-bot-user-id.age".publicKeys = [ thegeneralist ]; + "hosts/thegeneralist/crosspost/api-token.age".publicKeys = [ thegeneralist ]; + "hosts/thegeneralist/crosspost/worker-key.age".publicKeys = [ thegeneralist ]; "modules/linux/tailscale-marshall.age".publicKeys = [ thegeneralist ]; }