ATproto Nix User Repo

restarted with just bluesky/indigo

+5 -2
default.nix
··· 14 14 modules = import ./modules; # NixOS modules 15 15 overlays = import ./overlays; # nixpkgs overlays 16 16 17 - bluesky = pkgs.callPackage ./pkgs/bluesky { }; 18 - } 17 + bluesky = pkgs.callPackage ./pkgs/bluesky { 18 + buildGoModule = pkgs.buildGoModule; 19 + fetchFromGitHub = pkgs.fetchFromGitHub; 20 + }; 21 + }
+12 -12
flake.lock
··· 2 2 "nodes": { 3 3 "crane": { 4 4 "locked": { 5 - "lastModified": 1758215636, 6 - "narHash": "sha256-8nkzkPbdxze8CxWhKWlcLbJEU1vfLM/nVqRlTy17V54=", 5 + "lastModified": 1758758545, 6 + "narHash": "sha256-NU5WaEdfwF6i8faJ2Yh+jcK9vVFrofLcwlD/mP65JrI=", 7 7 "owner": "ipetkov", 8 8 "repo": "crane", 9 - "rev": "a669fe77a8b0cd6f11419d89ea45a16691ca5121", 9 + "rev": "95d528a5f54eaba0d12102249ce42f4d01f4e364", 10 10 "type": "github" 11 11 }, 12 12 "original": { ··· 79 79 }, 80 80 "nixpkgs": { 81 81 "locked": { 82 - "lastModified": 1758262103, 83 - "narHash": "sha256-aBGl3XEOsjWw6W3AHiKibN7FeoG73dutQQEqnd/etR8=", 82 + "lastModified": 1758446476, 83 + "narHash": "sha256-5rdAi7CTvM/kSs6fHe1bREIva5W3TbImsto+dxG4mBo=", 84 84 "owner": "NixOS", 85 85 "repo": "nixpkgs", 86 - "rev": "12bd230118a1901a4a5d393f9f56b6ad7e571d01", 86 + "rev": "a1f79a1770d05af18111fbbe2a3ab2c42c0f6cd0", 87 87 "type": "github" 88 88 }, 89 89 "original": { ··· 139 139 "nixpkgs": "nixpkgs_2" 140 140 }, 141 141 "locked": { 142 - "lastModified": 1758422215, 143 - "narHash": "sha256-JvF5SXhp1wBHbfEVAWgJCDVSO8iknfDqXfqMch5YWg0=", 142 + "lastModified": 1758767687, 143 + "narHash": "sha256-znUulOqcL/Kkdr7CkyIi8Z1pTGXpi54Xg2FmlyJmv4A=", 144 144 "owner": "oxalica", 145 145 "repo": "rust-overlay", 146 - "rev": "6f3988eb5885f1e2efa874a480d91de09a7f9f0b", 146 + "rev": "b8bcc09d4f627f4e325408f6e7a85c3ac31f0eeb", 147 147 "type": "github" 148 148 }, 149 149 "original": { ··· 159 159 "nixpkgs": "nixpkgs_3" 160 160 }, 161 161 "locked": { 162 - "lastModified": 1758272005, 163 - "narHash": "sha256-1u3xTH+3kaHhztPmWtLAD8LF5pTYLR2CpsPFWTFnVtQ=", 162 + "lastModified": 1758662783, 163 + "narHash": "sha256-igrxT+/MnmcftPOHEb+XDwAMq3Xg1Xy7kVYQaHhPlAg=", 164 164 "owner": "NuschtOS", 165 165 "repo": "search", 166 - "rev": "aa975a3757f28ce862812466c5848787b868e116", 166 + "rev": "7d4c0fc4ffe3bd64e5630417162e9e04e64b27a4", 167 167 "type": "github" 168 168 }, 169 169 "original": {
+5 -4
flake.nix
··· 31 31 nurPackages = import ./default.nix { 32 32 inherit pkgs craneLib; 33 33 }; 34 + packages = pkgs.lib.filterAttrs (n: v: pkgs.lib.isDerivation v) nurPackages; 34 35 in 35 36 { 36 - packages = nurPackages // { 37 - default = nurPackages.bluesky; 37 + packages = packages // { 38 + default = packages.bluesky; 38 39 search = search.packages.${system}.default; 39 40 }; 40 - legacyPackages = nurPackages; 41 + legacyPackages = packages; 41 42 nixosModules = { 42 43 nur-atproto = import ./modules; 43 44 search = search.nixosModules.default; ··· 47 48 }; 48 49 } 49 50 ); 50 - } 51 + }
+45
modules/bluesky/beemo.nix
··· 1 + { lib, config, pkgs, ... }: 2 + 3 + with lib; 4 + 5 + let 6 + cfg = config.services.beemo; 7 + in 8 + { 9 + options.services.beemo = { 10 + enable = mkEnableOption "beemo"; 11 + 12 + package = mkOption { 13 + type = types.package; 14 + default = pkgs.bluesky; 15 + description = "The beemo package to use."; 16 + }; 17 + 18 + slackWebhookUrl = mkOption { 19 + type = types.str; 20 + description = "Slack webhook URL."; 21 + }; 22 + }; 23 + 24 + config = mkIf cfg.enable { 25 + systemd.services.beemo-notify-reports = { 26 + description = "beemo notify-reports service"; 27 + after = [ "network.target" ]; 28 + wantedBy = [ "multi-user.target" ]; 29 + serviceConfig = { 30 + ExecStart = "${cfg.package}/bin/beemo notify-reports --slack-webhook-url ${cfg.slackWebhookUrl}"; 31 + Restart = "on-failure"; 32 + }; 33 + }; 34 + 35 + systemd.services.beemo-notify-mentions = { 36 + description = "beemo notify-mentions service"; 37 + after = [ "network.target" ]; 38 + wantedBy = [ "multi-user.target" ]; 39 + serviceConfig = { 40 + ExecStart = "${cfg.package}/bin/beemo notify-mentions --slack-webhook-url ${cfg.slackWebhookUrl}"; 41 + Restart = "on-failure"; 42 + }; 43 + }; 44 + }; 45 + }
+30
modules/bluesky/bigsky.nix
··· 1 + { lib, config, pkgs, ... }: 2 + 3 + with lib; 4 + 5 + let 6 + cfg = config.services.bigsky; 7 + in 8 + { 9 + options.services.bigsky = { 10 + enable = mkEnableOption "bigsky"; 11 + 12 + package = mkOption { 13 + type = types.package; 14 + default = pkgs.bluesky; 15 + description = "The bigsky package to use."; 16 + }; 17 + }; 18 + 19 + config = mkIf cfg.enable { 20 + systemd.services.bigsky = { 21 + description = "bigsky service"; 22 + after = [ "network.target" ]; 23 + wantedBy = [ "multi-user.target" ]; 24 + serviceConfig = { 25 + ExecStart = "${cfg.package}/bin/bigsky"; 26 + Restart = "on-failure"; 27 + }; 28 + }; 29 + }; 30 + }
+12
modules/bluesky/default.nix
··· 1 + { lib, config, pkgs, ... }: 2 + 3 + { 4 + imports = [ 5 + ./bigsky.nix 6 + ./relay.nix 7 + ./hepa.nix 8 + ./palomar.nix 9 + ./beemo.nix 10 + ./sonar.nix 11 + ]; 12 + }
+95
modules/bluesky/hepa.nix
··· 1 + { lib, config, pkgs, ... }: 2 + 3 + with lib; 4 + 5 + let 6 + cfg = config.services.hepa; 7 + in 8 + { 9 + options.services.hepa = { 10 + enable = mkEnableOption "hepa"; 11 + 12 + package = mkOption { 13 + type = types.package; 14 + default = pkgs.bluesky; 15 + description = "The hepa package to use."; 16 + }; 17 + 18 + atpRelayHost = mkOption { 19 + type = types.str; 20 + default = "wss://bsky.network"; 21 + description = "ATP relay host."; 22 + }; 23 + 24 + atpPlcHost = mkOption { 25 + type = types.str; 26 + default = "https://plc.directory"; 27 + description = "ATP PLC host."; 28 + }; 29 + 30 + atpBskyHost = mkOption { 31 + type = types.str; 32 + default = "https://public.api.bsky.app"; 33 + description = "ATP bsky host."; 34 + }; 35 + 36 + atpOzoneHost = mkOption { 37 + type = types.str; 38 + default = "https://mod.bsky.app"; 39 + description = "ATP ozone host."; 40 + }; 41 + 42 + ozoneDid = mkOption { 43 + type = types.str; 44 + description = "Ozone DID."; 45 + }; 46 + 47 + ozoneAdminToken = mkOption { 48 + type = types.str; 49 + description = "Ozone admin token."; 50 + }; 51 + 52 + atpPdsHost = mkOption { 53 + type = types.str; 54 + default = "https://bsky.social"; 55 + description = "ATP PDS host."; 56 + }; 57 + 58 + pdsAdminToken = mkOption { 59 + type = types.str; 60 + description = "PDS admin token."; 61 + }; 62 + 63 + redisUrl = mkOption { 64 + type = types.str; 65 + description = "Redis URL."; 66 + }; 67 + 68 + hiveaiApiToken = mkOption { 69 + type = types.str; 70 + description = "Hive AI API token."; 71 + }; 72 + 73 + abyssHost = mkOption { 74 + type = types.str; 75 + description = "Abyss host."; 76 + }; 77 + 78 + abyssPassword = mkOption { 79 + type = types.str; 80 + description = "Abyss password."; 81 + }; 82 + }; 83 + 84 + config = mkIf cfg.enable { 85 + systemd.services.hepa = { 86 + description = "hepa service"; 87 + after = [ "network.target" ]; 88 + wantedBy = [ "multi-user.target" ]; 89 + serviceConfig = { 90 + ExecStart = "${cfg.package}/bin/hepa run --atp-relay-host ${cfg.atpRelayHost} --atp-plc-host ${cfg.atpPlcHost} --atp-bsky-host ${cfg.atpBskyHost} --atp-ozone-host ${cfg.atpOzoneHost} --ozone-did ${cfg.ozoneDid} --ozone-admin-token ${cfg.ozoneAdminToken} --atp-pds-host ${cfg.atpPdsHost} --pds-admin-token ${cfg.pdsAdminToken} --redis-url ${cfg.redisUrl} --hiveai-api-token ${cfg.hiveaiApiToken} --abyss-host ${cfg.abyssHost} --abyss-password ${cfg.abyssPassword}"; 91 + Restart = "on-failure"; 92 + }; 93 + }; 94 + }; 95 + }
+83
modules/bluesky/palomar.nix
··· 1 + { lib, config, pkgs, ... }: 2 + 3 + with lib; 4 + 5 + let 6 + cfg = config.services.palomar; 7 + in 8 + { 9 + options.services.palomar = { 10 + enable = mkEnableOption "palomar"; 11 + 12 + package = mkOption { 13 + type = types.package; 14 + default = pkgs.bluesky; 15 + description = "The palomar package to use."; 16 + }; 17 + 18 + elasticCertFile = mkOption { 19 + type = types.str; 20 + description = "Elasticsearch cert file."; 21 + }; 22 + 23 + elasticInsecureSsl = mkOption { 24 + type = types.bool; 25 + default = false; 26 + description = "Elasticsearch insecure SSL."; 27 + }; 28 + 29 + elasticUsername = mkOption { 30 + type = types.str; 31 + default = "admin"; 32 + description = "Elasticsearch username."; 33 + }; 34 + 35 + elasticPassword = mkOption { 36 + type = types.str; 37 + default = "0penSearch-Pal0mar"; 38 + description = "Elasticsearch password."; 39 + }; 40 + 41 + elasticHosts = mkOption { 42 + type = types.str; 43 + default = "http://localhost:9200"; 44 + description = "Elasticsearch hosts."; 45 + }; 46 + 47 + esPostIndex = mkOption { 48 + type = types.str; 49 + default = "palomar_post"; 50 + description = "Elasticsearch post index."; 51 + }; 52 + 53 + esProfileIndex = mkOption { 54 + type = types.str; 55 + default = "palomar_profile"; 56 + description = "Elasticsearch profile index."; 57 + }; 58 + 59 + atpRelayHost = mkOption { 60 + type = types.str; 61 + default = "wss://bsky.network"; 62 + description = "ATP relay host."; 63 + }; 64 + 65 + atpPlcHost = mkOption { 66 + type = types.str; 67 + default = "https://plc.directory"; 68 + description = "ATP PLC host."; 69 + }; 70 + }; 71 + 72 + config = mkIf cfg.enable { 73 + systemd.services.palomar = { 74 + description = "palomar service"; 75 + after = [ "network.target" ]; 76 + wantedBy = [ "multi-user.target" ]; 77 + serviceConfig = { 78 + ExecStart = "${cfg.package}/bin/palomar run --elastic-cert-file ${cfg.elasticCertFile} --elastic-insecure-ssl ${toString cfg.elasticInsecureSsl} --elastic-username ${cfg.elasticUsername} --elastic-password ${cfg.elasticPassword} --elastic-hosts ${cfg.elasticHosts} --es-post-index ${cfg.esPostIndex} --es-profile-index ${cfg.esProfileIndex} --atp-relay-host ${cfg.atpRelayHost} --atp-plc-host ${cfg.atpPlcHost}"; 79 + Restart = "on-failure"; 80 + }; 81 + }; 82 + }; 83 + }
+41
modules/bluesky/relay.nix
··· 1 + { lib, config, pkgs, ... }: 2 + 3 + with lib; 4 + 5 + let 6 + cfg = config.services.relay; 7 + in 8 + { 9 + options.services.relay = { 10 + enable = mkEnableOption "relay"; 11 + 12 + package = mkOption { 13 + type = types.package; 14 + default = pkgs.bluesky; 15 + description = "The relay package to use."; 16 + }; 17 + 18 + adminPassword = mkOption { 19 + type = types.str; 20 + description = "Admin password for the relay."; 21 + }; 22 + 23 + plcHost = mkOption { 24 + type = types.str; 25 + default = "https://plc.directory"; 26 + description = "PLC host for the relay."; 27 + }; 28 + }; 29 + 30 + config = mkIf cfg.enable { 31 + systemd.services.relay = { 32 + description = "relay service"; 33 + after = [ "network.target" ]; 34 + wantedBy = [ "multi-user.target" ]; 35 + serviceConfig = { 36 + ExecStart = "${cfg.package}/bin/relay serve --admin-password ${cfg.adminPassword} --plc-host ${cfg.plcHost}"; 37 + Restart = "on-failure"; 38 + }; 39 + }; 40 + }; 41 + }
+61
modules/bluesky/sonar.nix
··· 1 + { lib, config, pkgs, ... }: 2 + 3 + with lib; 4 + 5 + let 6 + cfg = config.services.sonar; 7 + in 8 + { 9 + options.services.sonar = { 10 + enable = mkEnableOption "sonar"; 11 + 12 + package = mkOption { 13 + type = types.package; 14 + default = pkgs.bluesky; 15 + description = "The sonar package to use."; 16 + }; 17 + 18 + wsUrl = mkOption { 19 + type = types.str; 20 + default = "wss://bsky.network/xrpc/com.atproto.sync.subscribeRepos"; 21 + description = "Websocket URL."; 22 + }; 23 + 24 + logLevel = mkOption { 25 + type = types.str; 26 + default = "info"; 27 + description = "Log level."; 28 + }; 29 + 30 + port = mkOption { 31 + type = types.port; 32 + default = 8345; 33 + description = "Metrics server port."; 34 + }; 35 + 36 + maxQueueSize = mkOption { 37 + type = types.int; 38 + default = 10; 39 + description = "Max queue size."; 40 + }; 41 + 42 + cursorFile = mkOption { 43 + type = types.str; 44 + default = "/var/lib/sonar/cursor.json"; 45 + description = "Cursor file."; 46 + }; 47 + }; 48 + 49 + config = mkIf cfg.enable { 50 + systemd.services.sonar = { 51 + description = "sonar service"; 52 + after = [ "network.target" ]; 53 + wantedBy = [ "multi-user.target" ]; 54 + serviceConfig = { 55 + ExecStart = "${cfg.package}/bin/sonar --ws-url ${cfg.wsUrl} --log-level ${cfg.logLevel} --port ${toString cfg.port} --max-queue-size ${toString cfg.maxQueueSize} --cursor-file ${cfg.cursorFile}"; 56 + Restart = "on-failure"; 57 + StateDirectory = "sonar"; 58 + }; 59 + }; 60 + }; 61 + }
+2 -1
modules/default.nix
··· 1 1 { 2 2 imports = [ 3 + ./bluesky 3 4 ]; 4 - } 5 + }
+36 -8
pkgs/bluesky/default.nix
··· 1 - { stdenv }: 1 + { lib, buildGoModule, fetchFromGitHub }: 2 2 3 - stdenv.mkDerivation rec { 4 - name = "example-package-${version}"; 5 - version = "1.0"; 6 - src = ./.; 7 - buildPhase = "echo echo Hello World > example"; 8 - installPhase = "install -Dm755 example $out"; 9 - } 3 + buildGoModule rec { 4 + pname = "indigo"; 5 + version = "unstable-2023-09-24"; 6 + 7 + src = fetchFromGitHub { 8 + owner = "bluesky-social"; 9 + repo = "indigo"; 10 + rev = "b4dd6383c76ffe205afe5407a027bb90a7461b12"; 11 + sha256 = "sha256-e0Y/k1RBnFg8Z9VT7rxuZeyvJo2MZIOHQJbo9prTaoQ="; 12 + }; 13 + 14 + vendorHash = "sha256-7mYvgvR0tZdEnUgUYzKv6d2QyeXXnrFgVwY8/4UM3oU="; 15 + 16 + subPackages = [ 17 + "cmd/goat" 18 + "cmd/gosky" 19 + "cmd/bigsky" 20 + "cmd/relay" 21 + "cmd/beemo" 22 + "cmd/lexgen" 23 + "cmd/stress" 24 + "cmd/fakermaker" 25 + "cmd/hepa" 26 + "cmd/supercollider" 27 + "cmd/sonar" 28 + "cmd/palomar" 29 + ]; 30 + 31 + meta = with lib; { 32 + description = "Go source code for Bluesky's atproto services"; 33 + homepage = "https://github.com/bluesky-social/indigo"; 34 + license = licenses.mit; 35 + maintainers = with maintainers; [ ]; 36 + }; 37 + }