ATproto Nix User Repo

Compare changes

Choose any two refs to compare.

+2 -2
.tangled/workflows/build.yml
··· 5 5 engine: "nixery" 6 6 7 7 environment: 8 - NIX_CONFIG: "sandbox = false" 8 + 9 9 10 10 dependencies: 11 11 nixpkgs: ··· 14 14 steps: 15 15 - name: Build Nix packages 16 16 command: | 17 - nix build .#default --option sandbox false 17 + nix build .#default
+5 -3
default.nix
··· 14 14 modules = import ./modules; # NixOS modules 15 15 overlays = import ./overlays; # nixpkgs overlays 16 16 17 - microcosm = pkgs.callPackage ./pkgs/microcosm { inherit craneLib; }; 18 - blacksky = pkgs.callPackage ./pkgs/blacksky { inherit craneLib buildYarnPackage; }; 19 - } 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": {
+6 -5
flake.nix
··· 26 26 inherit system overlays; 27 27 }; 28 28 rustVersion = pkgs.rust-bin.stable.latest.default; 29 - craneLib = ((crane.mkLib pkgs).overrideToolchain rustVersion).overrideScope (import ./overlays/cfg-if-fix.nix); 29 + craneLib = (crane.mkLib pkgs).overrideToolchain rustVersion; 30 30 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.microcosm.default; 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 + }
-35
modules/blacksky/community.nix
··· 1 - # This module configures the Blacksky Community web client service. 2 - 3 - { config, lib, pkgs, ... }: 4 - 5 - with lib; 6 - 7 - { 8 - options.blacksky.community = { 9 - enable = mkEnableOption "Blacksky Community web client service."; 10 - port = mkOption { 11 - type = types.port; 12 - default = 80; 13 - description = "Port for the Blacksky Community web client."; 14 - }; 15 - hostName = mkOption { 16 - type = types.str; 17 - default = "localhost"; 18 - description = "Host name for the Blacksky Community web client."; 19 - }; 20 - }; 21 - 22 - config = mkIf config.blacksky.community.enable { 23 - services.nginx = { 24 - enable = true; 25 - virtualHosts.${config.blacksky.community.hostName} = { 26 - enable = true; 27 - root = "${pkgs.blacksky.community}/share/nginx/html"; 28 - listen = [{ 29 - addr = "127.00.1"; 30 - port = config.blacksky.community.port; 31 - }]; 32 - }; 33 - }; 34 - }; 35 - }
-31
modules/blacksky/default.nix
··· 1 - # This module aggregates all Blacksky AT Protocol services. 2 - 3 - { config, lib, pkgs, ... }: 4 - 5 - with lib; 6 - 7 - { 8 - imports = [ 9 - ./rsky/pds.nix 10 - ./rsky/relay.nix 11 - ./rsky/feedgen.nix 12 - ./rsky/satnav.nix 13 - ./rsky/firehose.nix 14 - ./rsky/jetstream-subscriber.nix 15 - ./rsky/labeler.nix 16 - # Individual service modules will be imported here 17 - ]; 18 - 19 - options.blacksky = { 20 - enable = mkEnableOption "Blacksky AT Protocol services"; 21 - }; 22 - 23 - config = mkIf config.blacksky.enable { 24 - blacksky.pds.enable = false; 25 - blacksky.feedgen.enable = false; 26 - blacksky.satnav.enable = false; 27 - blacksky.firehose.enable = false; 28 - blacksky.jetstream-subscriber.enable = false; 29 - blacksky.labeler.enable = false; 30 - }; 31 - }
-32
modules/blacksky/rsky/feedgen.nix
··· 1 - # This module configures the Blacksky Feed Generator service. 2 - 3 - { config, lib, pkgs, ... }: 4 - 5 - with lib; 6 - 7 - { 8 - options.blacksky.feedgen = { 9 - enable = mkEnableOption "Blacksky Feed Generator service."; 10 - port = mkOption { 11 - type = types.port; 12 - default = 8001; 13 - description = "Port for the Blacksky Feed Generator service."; 14 - }; 15 - # Add other options specific to the feedgen service 16 - }; 17 - 18 - config = mkIf config.blacksky.feedgen.enable { 19 - systemd.services.blacksky-feedgen = { 20 - description = "Blacksky Feed Generator service"; 21 - after = [ "network.target" ]; 22 - wantedBy = [ "multi-user.target" ]; 23 - serviceConfig = { 24 - ExecStart = "${pkgs.blacksky.feedgen}/bin/rsky-feedgen"; 25 - Restart = "always"; 26 - DynamicUser = true; 27 - StateDirectory = "blacksky-feedgen"; 28 - # Add other environment variables or arguments as needed by rsky-feedgen 29 - }; 30 - }; 31 - }; 32 - }
-32
modules/blacksky/rsky/firehose.nix
··· 1 - # This module configures the Blacksky Firehose service. 2 - 3 - { config, lib, pkgs, ... }: 4 - 5 - with lib; 6 - 7 - { 8 - options.blacksky.firehose = { 9 - enable = mkEnableOption "Blacksky Firehose service."; 10 - port = mkOption { 11 - type = types.port; 12 - default = 8003; 13 - description = "Port for the Blacksky Firehose service."; 14 - }; 15 - # Add other options specific to the firehose service 16 - }; 17 - 18 - config = mkIf config.blacksky.firehose.enable { 19 - systemd.services.blacksky-firehose = { 20 - description = "Blacksky Firehose service"; 21 - after = [ "network.target" ]; 22 - wantedBy = [ "multi-user.target" ]; 23 - serviceConfig = { 24 - ExecStart = "${pkgs.blacksky.firehose}/bin/rsky-firehose"; 25 - Restart = "always"; 26 - DynamicUser = true; 27 - StateDirectory = "blacksky-firehose"; 28 - # Add other environment variables or arguments as needed by rsky-firehose 29 - }; 30 - }; 31 - }; 32 - }
-32
modules/blacksky/rsky/jetstream-subscriber.nix
··· 1 - # This module configures the Blacksky Jetstream Subscriber service. 2 - 3 - { config, lib, pkgs, ... }: 4 - 5 - with lib; 6 - 7 - { 8 - options.blacksky.jetstreamSubscriber = { 9 - enable = mkEnableOption "Blacksky Jetstream Subscriber service."; 10 - port = mkOption { 11 - type = types.port; 12 - default = 8004; 13 - description = "Port for the Blacksky Jetstream Subscriber service."; 14 - }; 15 - # Add other options specific to the jetstream subscriber service 16 - }; 17 - 18 - config = mkIf config.blacksky.jetstreamSubscriber.enable { 19 - systemd.services.blacksky-jetstream-subscriber = { 20 - description = "Blacksky Jetstream Subscriber service"; 21 - after = [ "network.target" ]; 22 - wantedBy = [ "multi-user.target" ]; 23 - serviceConfig = { 24 - ExecStart = "${pkgs.blacksky.jetstreamSubscriber}/bin/rsky-jetstream-subscriber"; 25 - Restart = "always"; 26 - DynamicUser = true; 27 - StateDirectory = "blacksky-jetstream-subscriber"; 28 - # Add other environment variables or arguments as needed by rsky-jetstream-subscriber 29 - }; 30 - }; 31 - }; 32 - }
-32
modules/blacksky/rsky/labeler.nix
··· 1 - # This module configures the Blacksky Labeler service. 2 - 3 - { config, lib, pkgs, ... }: 4 - 5 - with lib; 6 - 7 - { 8 - options.blacksky.labeler = { 9 - enable = mkEnableOption "Blacksky Labeler service."; 10 - port = mkOption { 11 - type = types.port; 12 - default = 8005; 13 - description = "Port for the Blacksky Labeler service."; 14 - }; 15 - # Add other options specific to the labeler service 16 - }; 17 - 18 - config = mkIf config.blacksky.labeler.enable { 19 - systemd.services.blacksky-labeler = { 20 - description = "Blacksky Labeler service"; 21 - after = [ "network.target" ]; 22 - wantedBy = [ "multi-user.target" ]; 23 - serviceConfig = { 24 - ExecStart = "${pkgs.blacksky.labeler}/bin/rsky-labeler"; 25 - Restart = "always"; 26 - DynamicUser = true; 27 - StateDirectory = "blacksky-labeler"; 28 - # Add other environment variables or arguments as needed by rsky-labeler 29 - }; 30 - }; 31 - }; 32 - }
-38
modules/blacksky/rsky/pds.nix
··· 1 - # This module configures the Blacksky PDS service. 2 - 3 - { config, lib, pkgs, ... }: 4 - 5 - with lib; 6 - 7 - { 8 - options.blacksky.pds = { 9 - enable = mkEnableOption "Blacksky PDS service."; 10 - port = mkOption { 11 - type = types.port; 12 - default = 3000; 13 - description = "Port for the Blacksky PDS service."; 14 - }; 15 - dataDir = mkOption { 16 - type = types.str; 17 - default = "/var/lib/blacksky-pds"; 18 - description = "Data directory for the Blacksky PDS service."; 19 - }; 20 - }; 21 - 22 - config = mkIf config.blacksky.pds.enable { 23 - systemd.services.blacksky-pds = { 24 - description = "Blacksky PDS service"; 25 - after = [ "network.target" ]; 26 - wantedBy = [ "multi-user.target" ]; 27 - serviceConfig = { 28 - ExecStart = "${pkgs.blacksky.pds}/bin/rsky-pds"; 29 - Restart = "always"; 30 - DynamicUser = true; 31 - # Ensure data directory exists and has correct permissions 32 - preStart = '' 33 - mkdir -p ${config.blacksky.pds.dataDir} 34 - chown -R blacksky-pds:blacksky-pds ${config.blacksky.pds.dataDir} 35 - ''; 36 - }; 37 - }; 38 - }
-32
modules/blacksky/rsky/relay.nix
··· 1 - # This module configures the Blacksky Relay service. 2 - 3 - { config, lib, pkgs, ... }: 4 - 5 - with lib; 6 - 7 - { 8 - options.blacksky.relay = { 9 - enable = mkEnableOption "Blacksky Relay service."; 10 - port = mkOption { 11 - type = types.port; 12 - default = 8000; 13 - description = "Port for the Blacksky Relay service."; 14 - }; 15 - # Add other options specific to the relay service, e.g., certs, private_key 16 - }; 17 - 18 - config = mkIf config.blacksky.relay.enable { 19 - systemd.services.blacksky-relay = { 20 - description = "Blacksky Relay service"; 21 - after = [ "network.target" ]; 22 - wantedBy = [ "multi-user.target" ]; 23 - serviceConfig = { 24 - ExecStart = "${pkgs.blacksky.relay}/bin/rsky-relay"; 25 - Restart = "always"; 26 - DynamicUser = true; 27 - StateDirectory = "blacksky-relay"; 28 - # Add other environment variables or arguments as needed by rsky-relay 29 - }; 30 - }; 31 - }; 32 - }
-33
modules/blacksky/rsky/satnav.nix
··· 1 - # This module configures the Blacksky Satnav service. 2 - 3 - { config, lib, pkgs, ... }: 4 - 5 - with lib; 6 - 7 - { 8 - options.blacksky.satnav = { 9 - enable = mkEnableOption "Blacksky Satnav service."; 10 - port = mkOption { 11 - type = types.port; 12 - default = 8002; 13 - description = "Port for the Blacksky Satnav service."; 14 - }; 15 - # Satnav is a web UI, so it might need a web server configuration 16 - # For simplicity, we'll just run the binary directly for now. 17 - }; 18 - 19 - config = mkIf config.blacksky.satnav.enable { 20 - systemd.services.blacksky-satnav = { 21 - description = "Blacksky Satnav service"; 22 - after = [ "network.target" ]; 23 - wantedBy = [ "multi-user.target" ]; 24 - serviceConfig = { 25 - ExecStart = "${pkgs.blacksky.satnav}/bin/rsky-satnav"; 26 - Restart = "always"; 27 - DynamicUser = true; 28 - StateDirectory = "blacksky-satnav"; 29 - # Add other environment variables or arguments as needed by rsky-satnav 30 - }; 31 - }; 32 - }; 33 - }
+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 -3
modules/default.nix
··· 1 1 { 2 2 imports = [ 3 - ./blacksky 4 - ./microcosm 3 + ./bluesky 5 4 ]; 6 - } 5 + }
-55
modules/microcosm/constellation.nix
··· 1 - # This module configures the Microcosm Constellation service. 2 - 3 - { config, lib, pkgs, ... }: 4 - 5 - with lib; 6 - 7 - let 8 - cfg = config.services.microcosm-constellation; 9 - microcosmPkgs = pkgs.microcosm; # Access the packages we built 10 - in 11 - { 12 - options.services.microcosm-constellation = { 13 - enable = mkEnableOption "Microcosm Constellation service."; 14 - package = mkOption { 15 - type = types.package; 16 - default = microcosmPkgs.constellation; 17 - description = "The Microcosm Constellation package to use."; 18 - }; 19 - port = mkOption { 20 - type = types.port; 21 - default = 8080; # Example default port 22 - description = "The port on which the Constellation service listens."; 23 - }; 24 - jetstream = mkOption { 25 - type = types.str; 26 - description = "Jetstream server to connect to."; 27 - }; 28 - data = mkOption { 29 - type = types.str; 30 - default = "/var/lib/microcosm-constellation"; 31 - description = "Where to store data on disk."; 32 - }; 33 - backend = mkOption { 34 - type = types.str; 35 - default = "memory"; 36 - description = "Storage backend to use."; 37 - }; 38 - # Add other service-specific options here (e.g., databaseUrl, logLevel) 39 - }; 40 - 41 - config = mkIf cfg.enable { 42 - systemd.services.microcosm-constellation = { 43 - description = "Microcosm Constellation Service"; 44 - after = [ "network.target" ]; 45 - wantedBy = [ "multi-user.target" ]; 46 - serviceConfig = { 47 - ExecStart = "${cfg.package}/bin/main --jetstream ${cfg.jetstream} --data ${cfg.data} --backend ${cfg.backend}"; 48 - Restart = "always"; 49 - DynamicUser = true; 50 - StateDirectory = "microcosm-constellation"; 51 - # Add other systemd options as needed (e.g., working directory, environment variables) 52 - }; 53 - }; 54 - }; 55 - }
-17
modules/microcosm/default.nix
··· 1 - # This module aggregates all Microcosm services. 2 - 3 - { pkgs, ... }: 4 - 5 - { 6 - imports = [ 7 - ./constellation.nix 8 - ./spacedust.nix 9 - ./slingshot.nix 10 - ./ufos.nix 11 - ./jetstream.nix 12 - ./who-am-i.nix 13 - ./quasar.nix 14 - ./pocket.nix 15 - ./reflector.nix 16 - ]; 17 - }
-42
modules/microcosm/jetstream.nix
··· 1 - # This module configures the Microcosm Jetstream service. 2 - 3 - { config, lib, pkgs, ... }: 4 - 5 - with lib; 6 - 7 - let 8 - cfg = config.services.microcosm-jetstream; 9 - microcosmPkgs = pkgs.microcosm; 10 - in 11 - { 12 - options.services.microcosm-jetstream = { 13 - enable = mkEnableOption "Microcosm Jetstream service."; 14 - package = mkOption { 15 - type = types.package; 16 - default = microcosmPkgs.jetstream; 17 - description = "The Microcosm Jetstream package to use."; 18 - }; 19 - # Add other service-specific options here 20 - }; 21 - 22 - config = mkIf cfg.enable { 23 - systemd.services.microcosm-jetstream = { 24 - description = "Microcosm Jetstream Service"; 25 - after = [ "network.target" ]; 26 - wantedBy = [ "multi-user.target" ]; 27 - serviceConfig = { 28 - ExecStart = "${cfg.package}/bin/jetstream"; # This command likely needs adjustment 29 - Restart = "always"; 30 - User = "microcosm-jetstream"; 31 - Group = "microcosm-jetstream"; 32 - }; 33 - users.users.microcosm-jetstream = { 34 - isSystem = true; 35 - group = "microcosm-jetstream"; 36 - }; 37 - users.groups.microcosm-jetstream = { 38 - isSystem = true; 39 - }; 40 - }; 41 - }; 42 - }
-43
modules/microcosm/pocket.nix
··· 1 - # This module configures the Microcosm Pocket service. 2 - 3 - { config, lib, pkgs, ... }: 4 - 5 - with lib; 6 - 7 - let 8 - cfg = config.services.microcosm-pocket; 9 - microcosmPkgs = pkgs.microcosm; 10 - in 11 - { 12 - options.services.microcosm-pocket = { 13 - enable = mkEnableOption "Microcosm Pocket service."; 14 - package = mkOption { 15 - type = types.package; 16 - default = microcosmPkgs.pocket; 17 - description = "The Microcosm Pocket package to use."; 18 - }; 19 - db = mkOption { 20 - type = types.str; 21 - description = "path to the sqlite db file"; 22 - }; 23 - domain = mkOption { 24 - type = types.str; 25 - description = "the domain for serving a did doc"; 26 - }; 27 - # Add other service-specific options here 28 - }; 29 - 30 - config = mkIf cfg.enable { 31 - systemd.services.microcosm-pocket = { 32 - description = "Microcosm Pocket Service"; 33 - after = [ "network.target" ]; 34 - wantedBy = [ "multi-user.target" ]; 35 - serviceConfig = { 36 - ExecStart = "${cfg.package}/bin/pocket --db ${cfg.db} --domain ${cfg.domain}"; 37 - Restart = "always"; 38 - DynamicUser = true; 39 - StateDirectory = "microcosm-pocket"; 40 - }; 41 - }; 42 - }; 43 - }
-35
modules/microcosm/quasar.nix
··· 1 - # This module configures the Microcosm Quasar service. 2 - 3 - { config, lib, pkgs, ... }: 4 - 5 - with lib; 6 - 7 - let 8 - cfg = config.services.microcosm-quasar; 9 - microcosmPkgs = pkgs.microcosm; 10 - in 11 - { 12 - options.services.microcosm-quasar = { 13 - enable = mkEnableOption "Microcosm Quasar service."; 14 - package = mkOption { 15 - type = types.package; 16 - default = microcosmPkgs.quasar; 17 - description = "The Microcosm Quasar package to use."; 18 - }; 19 - # Add other service-specific options here 20 - }; 21 - 22 - config = mkIf cfg.enable { 23 - systemd.services.microcosm-quasar = { 24 - description = "Microcosm Quasar Service"; 25 - after = [ "network.target" ]; 26 - wantedBy = [ "multi-user.target" ]; 27 - serviceConfig = { 28 - ExecStart = "${cfg.package}/bin/quasar"; 29 - Restart = "always"; 30 - DynamicUser = true; 31 - StateDirectory = "microcosm-quasar"; 32 - }; 33 - }; 34 - }; 35 - }
-51
modules/microcosm/reflector.nix
··· 1 - # This module configures the Microcosm Reflector service. 2 - 3 - { config, lib, pkgs, ... }: 4 - 5 - with lib; 6 - 7 - let 8 - cfg = config.services.microcosm-reflector; 9 - microcosmPkgs = pkgs.microcosm; 10 - in 11 - { 12 - options.services.microcosm-reflector = { 13 - enable = mkEnableOption "Microcosm Reflector service."; 14 - package = mkOption { 15 - type = types.package; 16 - default = microcosmPkgs.reflector; 17 - description = "The Microcosm Reflector package to use."; 18 - }; 19 - id = mkOption { 20 - type = types.str; 21 - description = "The DID document service ID to serve"; 22 - }; 23 - type = mkOption { 24 - type = types.str; 25 - description = "Service type"; 26 - }; 27 - serviceEndpoint = mkOption { 28 - type = types.str; 29 - description = "The HTTPS endpoint for the service"; 30 - }; 31 - domain = mkOption { 32 - type = types.str; 33 - description = "The parent domain"; 34 - }; 35 - # Add other service-specific options here 36 - }; 37 - 38 - config = mkIf cfg.enable { 39 - systemd.services.microcosm-reflector = { 40 - description = "Microcosm Reflector Service"; 41 - after = [ "network.target" ]; 42 - wantedBy = [ "multi-user.target" ]; 43 - serviceConfig = { 44 - ExecStart = "${cfg.package}/bin/reflector --id ${cfg.id} --type ${cfg.type} --service-endpoint ${cfg.serviceEndpoint} --domain ${cfg.domain}"; 45 - Restart = "always"; 46 - DynamicUser = true; 47 - StateDirectory = "microcosm-reflector"; 48 - }; 49 - }; 50 - }; 51 - }
-55
modules/microcosm/slingshot.nix
··· 1 - # This module configures the Microcosm Slingshot service. 2 - 3 - { config, lib, pkgs, ... }: 4 - 5 - with lib; 6 - 7 - let 8 - cfg = config.services.microcosm-slingshot; 9 - microcosmPkgs = pkgs.microcosm; 10 - in 11 - { 12 - options.services.microcosm-slingshot = { 13 - enable = mkEnableOption "Microcosm Slingshot service."; 14 - package = mkOption { 15 - type = types.package; 16 - default = microcosmPkgs.slingshot; 17 - description = "The Microcosm Slingshot package to use."; 18 - }; 19 - jetstream = mkOption { 20 - type = types.str; 21 - description = "Jetstream server to connect to."; 22 - }; 23 - cacheDir = mkOption { 24 - type = types.str; 25 - description = "where to keep disk caches"; 26 - }; 27 - domain = mkOption { 28 - type = types.str; 29 - description = "the domain pointing to this server"; 30 - }; 31 - acmeContact = mkOption { 32 - type = types.str; 33 - description = "email address for letsencrypt contact"; 34 - }; 35 - certs = mkOption { 36 - type = types.str; 37 - description = "a location to cache acme https certs"; 38 - }; 39 - # Add other service-specific options here 40 - }; 41 - 42 - config = mkIf cfg.enable { 43 - systemd.services.microcosm-slingshot = { 44 - description = "Microcosm Slingshot Service"; 45 - after = [ "network.target" ]; 46 - wantedBy = [ "multi-user.target" ]; 47 - serviceConfig = { 48 - ExecStart = "${cfg.package}/bin/slingshot --jetstream ${cfg.jetstream} --cache-dir ${cfg.cacheDir} --domain ${cfg.domain} --acme-contact ${cfg.acmeContact} --certs ${cfg.certs}"; 49 - Restart = "always"; 50 - DynamicUser = true; 51 - StateDirectory = "microcosm-slingshot"; 52 - }; 53 - }; 54 - }; 55 - }
-44
modules/microcosm/spacedust.nix
··· 1 - # This module configures the Microcosm Spacedust service. 2 - 3 - { config, lib, pkgs, ... }: 4 - 5 - with lib; 6 - 7 - let 8 - cfg = config.services.microcosm-spacedust; 9 - microcosmPkgs = pkgs.microcosm; 10 - in 11 - { 12 - options.services.microcosm-spacedust = { 13 - enable = mkEnableOption "Microcosm Spacedust service."; 14 - package = mkOption { 15 - type = types.package; 16 - default = microcosmPkgs.spacedust; 17 - description = "The Microcosm Spacedust package to use."; 18 - }; 19 - jetstream = mkOption { 20 - type = types.str; 21 - description = "Jetstream server to connect to."; 22 - }; 23 - jetstreamNoZstd = mkOption { 24 - type = types.bool; 25 - default = false; 26 - description = "don't request zstd-compressed jetstream events"; 27 - }; 28 - # Add other service-specific options here 29 - }; 30 - 31 - config = mkIf cfg.enable { 32 - systemd.services.microcosm-spacedust = { 33 - description = "Microcosm Spacedust Service"; 34 - after = [ "network.target" ]; 35 - wantedBy = [ "multi-user.target" ]; 36 - serviceConfig = { 37 - ExecStart = "${cfg.package}/bin/spacedust --jetstream ${cfg.jetstream} ${lib.optionalString cfg.jetstreamNoZstd "--jetstream-no-zstd"}"; 38 - Restart = "always"; 39 - DynamicUser = true; 40 - StateDirectory = "microcosm-spacedust"; 41 - }; 42 - }; 43 - }; 44 - }
-78
modules/microcosm/ufos.nix
··· 1 - # This module configures the Microcosm UFOs service. 2 - 3 - { config, lib, pkgs, ... }: 4 - 5 - with lib; 6 - 7 - let 8 - cfg = config.services.microcosm-ufos; 9 - microcosmPkgs = pkgs.microcosm; 10 - in 11 - { 12 - options.services.microcosm-ufos = { 13 - enable = mkEnableOption "Microcosm UFOs service."; 14 - package = mkOption { 15 - type = types.package; 16 - default = microcosmPkgs.ufos; 17 - description = "The Microcosm UFOs package to use."; 18 - }; 19 - jetstream = mkOption { 20 - type = types.str; 21 - description = "Jetstream server to connect to."; 22 - }; 23 - data = mkOption { 24 - type = types.str; 25 - description = "Location to store persist data to disk"; 26 - }; 27 - jetstreamForce = mkOption { 28 - type = types.bool; 29 - default = false; 30 - description = "allow changing jetstream endpoints"; 31 - }; 32 - jetstreamNoZstd = mkOption { 33 - type = types.bool; 34 - default = false; 35 - description = "don't request zstd-compressed jetstream events"; 36 - }; 37 - pauseWriter = mkOption { 38 - type = types.bool; 39 - default = false; 40 - description = "DEBUG: don't start the jetstream consumer or its write loop"; 41 - }; 42 - backfill = mkOption { 43 - type = types.bool; 44 - default = false; 45 - description = "Adjust runtime settings like background task intervals for efficient backfill"; 46 - }; 47 - pauseRw = mkOption { 48 - type = types.bool; 49 - default = false; 50 - description = "DEBUG: force the rw loop to fall behind by pausing it todo: restore this"; 51 - }; 52 - reroll = mkOption { 53 - type = types.bool; 54 - default = false; 55 - description = "reset the rollup cursor, scrape through missed things in the past (backfill)"; 56 - }; 57 - jetstreamFixture = mkOption { 58 - type = types.bool; 59 - default = false; 60 - description = "DEBUG: interpret jetstream as a file fixture"; 61 - }; 62 - # Add other service-specific options here 63 - }; 64 - 65 - config = mkIf cfg.enable { 66 - systemd.services.microcosm-ufos = { 67 - description = "Microcosm UFOs Service"; 68 - after = [ "network.target" ]; 69 - wantedBy = [ "multi-user.target" ]; 70 - serviceConfig = { 71 - ExecStart = "${cfg.package}/bin/ufos --jetstream ${cfg.jetstream} --data ${cfg.data} ${lib.optionalString cfg.jetstreamForce "--jetstream-force"} ${lib.optionalString cfg.jetstreamNoZstd "--jetstream-no-zstd"} ${lib.optionalString cfg.pauseWriter "--pause-writer"} ${lib.optionalString cfg.backfill "--backfill"} ${lib.optionalString cfg.pauseRw "--pause-rw"} ${lib.optionalString cfg.reroll "--reroll"} ${lib.optionalString cfg.jetstreamFixture "--jetstream-fixture"}"; 72 - Restart = "always"; 73 - DynamicUser = true; 74 - StateDirectory = "microcosm-ufos"; 75 - }; 76 - }; 77 - }; 78 - }
-66
modules/microcosm/who-am-i.nix
··· 1 - # This module configures the Microcosm Who-Am-I service. 2 - 3 - { config, lib, pkgs, ... }: 4 - 5 - with lib; 6 - 7 - let 8 - cfg = config.services.microcosm-who-am-i; 9 - microcosmPkgs = pkgs.microcosm; 10 - in 11 - { 12 - options.services.microcosm-who-am-i = { 13 - enable = mkEnableOption "Microcosm Who-Am-I service."; 14 - package = mkOption { 15 - type = types.package; 16 - default = microcosmPkgs."who-am-i"; 17 - description = "The Microcosm Who-Am-I package to use."; 18 - }; 19 - appSecret = mkOption { 20 - type = types.str; 21 - description = "secret key from which the cookie-signing key is derived"; 22 - }; 23 - oauthPrivateKey = mkOption { 24 - type = types.str; 25 - description = "path to at-oauth private key (PEM pk8 format)"; 26 - }; 27 - jwtPrivateKey = mkOption { 28 - type = types.str; 29 - description = "path to jwt private key (PEM pk8 format)"; 30 - }; 31 - baseUrl = mkOption { 32 - type = types.str; 33 - description = "this server's client-reachable base url, for oauth redirect + jwt check"; 34 - }; 35 - bind = mkOption { 36 - type = types.str; 37 - default = "127.0.0.1:9997"; 38 - description = "host:port to bind to on startup"; 39 - }; 40 - dev = mkOption { 41 - type = types.bool; 42 - default = false; 43 - description = "Enable dev mode"; 44 - }; 45 - allowedHosts = mkOption { 46 - type = types.listOf types.str; 47 - default = []; 48 - description = "Hosts who are allowed to one-click auth"; 49 - }; 50 - # Add other service-specific options here 51 - }; 52 - 53 - config = mkIf cfg.enable { 54 - systemd.services.microcosm-who-am-i = { 55 - description = "Microcosm Who-Am-I Service"; 56 - after = [ "network.target" ]; 57 - wantedBy = [ "multi-user.target" ]; 58 - serviceConfig = { 59 - ExecStart = "${cfg.package}/bin/who-am-i --app-secret ${cfg.appSecret} --oauth-private-key ${cfg.oauthPrivateKey} --jwt-private-key ${cfg.jwtPrivateKey} --base-url ${cfg.baseUrl} --bind ${cfg.bind} ${lib.optionalString cfg.dev "--dev"} ${lib.concatMapStringsSep " " (host: "--allow_host " + host) cfg.allowedHosts}"; 60 - Restart = "always"; 61 - DynamicUser = true; 62 - StateDirectory = "microcosm-who-am-i"; 63 - }; 64 - }; 65 - }; 66 - }
-7
overlays/cfg-if-fix.nix
··· 1 - self: super: { 2 - "cfg-if" = super."cfg-if".overrideAttrs (old: { 3 - unpackPhase = '' 4 - tar -xzf $src --no-same-owner 5 - ''; 6 - }); 7 - }
-1
overlays/default.nix
··· 1 1 { 2 - cfg-if-fix = import ./cfg-if-fix.nix; 3 2 }
-3
pkgs/blacksky/default.nix
··· 1 - { pkgs, craneLib, buildYarnPackage, ... }: 2 - 3 - import ./rsky { inherit pkgs craneLib buildYarnPackage; }
-203
pkgs/blacksky/rsky/default.nix
··· 1 - { pkgs, craneLib, buildYarnPackage }: 2 - 3 - { 4 - pds = craneLib.buildPackage rec { 5 - pname = "rsky-pds"; 6 - version = "0.1.0"; # Placeholder version, should be updated from rsky's Cargo.toml 7 - src = pkgs.fetchFromGitHub { 8 - owner = "blacksky-algorithms"; 9 - repo = "rsky"; 10 - rev = "main"; # Placeholder, should be updated to a specific commit or tag 11 - hash = "sha256-nqBe20MCeNrSVxLVxiYc7iCFaBdf5Vf1p/i0D/aS8oY="; 12 - }; 13 - cargoHash = "sha256-0000000000000000000000000000000000000000000000000000000000000000="; 14 - 15 - # Build only the rsky-pds binary 16 - 17 - cargoBuildFlags = [ "--package rsky-pds --bin rsky-pds" ]; 18 - cargoInstallFlags = [ "--package rsky-pds --bin rsky-pds" ]; 19 - tarFlags = "--no-same-owner"; 20 - 21 - meta = with pkgs.lib; { 22 - description = "AT Protocol Personal Data Server (PDS) from rsky"; 23 - homepage = "https://github.com/atproto-nix/nur"; # Placeholder 24 - license = licenses.mit; # Placeholder 25 - maintainers = with maintainers; [ ]; # Placeholder 26 - }; 27 - }; 28 - 29 - relay = craneLib.buildPackage rec { 30 - pname = "rsky-relay"; 31 - version = "0.1.0"; # Placeholder version 32 - src = pkgs.fetchFromGitHub { 33 - owner = "blacksky-algorithms"; 34 - repo = "rsky"; 35 - rev = "main"; # Placeholder 36 - hash = "sha256-nqBe20MCeNrSVxLVxiYc7iCFaBdf5Vf1p/i0D/aS8oY="; 37 - }; 38 - cargoHash = "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA="; # Placeholder 39 - 40 - cargoBuildFlags = [ "--package rsky-relay --bin rsky-relay" ]; 41 - cargoInstallFlags = [ "--package rsky-relay --bin rsky-relay" ]; 42 - tarFlags = "--no-same-owner"; 43 - 44 - meta = with pkgs.lib; { 45 - description = "AT Protocol Relay from rsky"; 46 - homepage = "https://github.com/atproto-nix/nur"; 47 - license = licenses.mit; 48 - maintainers = with maintainers; [ ]; 49 - }; 50 - }; 51 - 52 - feedgen = craneLib.buildPackage rec { 53 - pname = "rsky-feedgen"; 54 - version = "0.1.0"; # Placeholder version 55 - src = pkgs.fetchFromGitHub { 56 - owner = "blacksky-algorithms"; 57 - repo = "rsky"; 58 - rev = "main"; # Placeholder 59 - hash = "sha256-nqBe20MCeNrSVxLVxiYc7iCFaBdf5Vf1p/i0D/aS8oY="; 60 - }; 61 - cargoHash = "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA="; # Placeholder 62 - 63 - cargoBuildFlags = [ "--package rsky-feedgen --bin rsky-feedgen" ]; 64 - cargoInstallFlags = [ "--package rsky-feedgen --bin rsky-feedgen" ]; 65 - tarFlags = "--no-same-owner"; 66 - 67 - meta = with pkgs.lib; { 68 - description = "AT Protocol Feed Generator from rsky"; 69 - homepage = "https://github.com/atproto-nix/nur"; 70 - license = licenses.mit; 71 - maintainers = with maintainers; [ ]; 72 - }; 73 - }; 74 - 75 - satnav = craneLib.buildPackage rec { 76 - pname = "rsky-satnav"; 77 - version = "0.1.0"; # Placeholder version 78 - src = pkgs.fetchFromGitHub { 79 - owner = "blacksky-algorithms"; 80 - repo = "rsky"; 81 - rev = "main"; # Placeholder 82 - hash = "sha256-nqBe20MCeNrSVxLVxiYc7iCFaBdf5Vf1p/i0D/aS8oY="; 83 - }; 84 - cargoHash = "sha256-0000000000000000000000000000000000000000000000000000000000000000="; # Placeholder, will be updated by Nix 85 - 86 - cargoBuildFlags = [ "--package rsky-satnav --bin rsky-satnav" ]; 87 - cargoInstallFlags = [ "--package rsky-satnav --bin rsky-satnav" ]; 88 - tarFlags = "--no-same-owner"; 89 - 90 - meta = with pkgs.lib; { 91 - description = "AT Protocol Satnav from rsky"; 92 - homepage = "https://github.com/atproto-nix/nur"; 93 - license = licenses.mit; 94 - maintainers = with maintainers; [ ]; 95 - }; 96 - }; 97 - 98 - firehose = craneLib.buildPackage rec { 99 - pname = "rsky-firehose"; 100 - version = "0.2.1"; # Version from Cargo.toml 101 - src = pkgs.fetchFromGitHub { 102 - owner = "blacksky-algorithms"; 103 - repo = "rsky"; 104 - rev = "main"; # Placeholder 105 - hash = "sha256-nqBe20MCeNrSVxLVxiYc7iCFaBdf5Vf1p/i0D/aS8oY="; 106 - }; 107 - cargoHash = "sha256-0000000000000000000000000000000000000000000000000000000000000000="; # Placeholder 108 - 109 - cargoBuildFlags = [ "--package rsky-firehose --bin rsky-firehose" ]; 110 - cargoInstallFlags = [ "--package rsky-firehose --bin rsky-firehose" ]; 111 - tarFlags = "--no-same-owner"; 112 - 113 - meta = with pkgs.lib; { 114 - description = "AT Protocol Firehose subscriber from rsky"; 115 - homepage = "https://github.com/atproto-nix/nur"; 116 - license = licenses.mit; 117 - maintainers = with maintainers; [ ]; 118 - }; 119 - }; 120 - 121 - jetstreamSubscriber = craneLib.buildPackage rec { 122 - pname = "rsky-jetstream-subscriber"; 123 - version = "0.1.0"; # Version from Cargo.toml 124 - src = pkgs.fetchFromGitHub { 125 - owner = "blacksky-algorithms"; 126 - repo = "rsky"; 127 - rev = "main"; # Placeholder 128 - hash = "sha256-nqBe20MCeNrSVxLVxiYc7iCFaBdf5Vf1p/i0D/aS8oY="; 129 - }; 130 - cargoHash = "sha256-0000000000000000000000000000000000000000000000000000000000000000="; # Placeholder 131 - 132 - cargoBuildFlags = [ "--package rsky-jetstream-subscriber --bin rsky-jetstream-subscriber" ]; 133 - cargoInstallFlags = [ "--package rsky-jetstream-subscriber --bin rsky-jetstream-subscriber" ]; 134 - tarFlags = "--no-same-owner"; 135 - 136 - meta = with pkgs.lib; { 137 - description = "AT Protocol Jetstream Subscriber from rsky"; 138 - homepage = "https://github.com/atproto-nix/nur"; 139 - license = licenses.mit; 140 - maintainers = with maintainers; [ ]; 141 - }; 142 - }; 143 - 144 - labeler = craneLib.buildPackage rec { 145 - pname = "rsky-labeler"; 146 - version = "0.1.3"; # Version from Cargo.toml 147 - src = pkgs.fetchFromGitHub { 148 - owner = "blacksky-algorithms"; 149 - repo = "rsky"; 150 - rev = "main"; # Placeholder 151 - hash = "sha256-nqBe20MCeNrSVxLVxiYc7iCFaBdf5Vf1p/i0D/aS8oY="; 152 - }; 153 - cargoHash = "sha256-0000000000000000000000000000000000000000000000000000000000000000="; # Placeholder 154 - 155 - cargoBuildFlags = [ "--package rsky-labeler --bin rsky-labeler" ]; 156 - cargoInstallFlags = [ "--package rsky-labeler --bin rsky-labeler" ]; 157 - tarFlags = "--no-same-owner"; 158 - 159 - meta = with pkgs.lib; { 160 - description = "AT Protocol Labeler from rsky"; 161 - homepage = "https://github.com/atproto-nix/nur"; 162 - license = licenses.mit; 163 - maintainers = with maintainers; [ ]; 164 - }; 165 - }; 166 - 167 - community = pkgs.buildYarnPackage rec { 168 - pname = "blacksky.community"; 169 - version = "1.109.0"; # Version from package.json 170 - 171 - src = pkgs.fetchFromGitHub { 172 - owner = "blacksky-algorithms"; 173 - repo = "blacksky.community"; 174 - # TODO: Update 'rev' to a specific commit hash or release tag for reproducible builds. 175 - rev = "main"; 176 - # TODO: Update 'hash' to the correct SHA256 hash of the fetched source. 177 - # You can obtain the correct hash by setting it to an empty string, running nix-build, 178 - # and then copying the hash from the error message. 179 - hash = "sha256-W0mXqED9geNKJSPGJhUdJZ2voMOMDCXX1T4zn3GZKlY="; 180 - }; 181 - 182 - yarnLock = "yarn.lock"; # Specify the yarn.lock file 183 - 184 - buildPhase = '' 185 - yarn build-web 186 - ''; 187 - 188 - installPhase = '' 189 - mkdir -p $out/share/nginx/html 190 - cp -r web-build/* $out/share/nginx/html 191 - ''; 192 - 193 - meta = with pkgs.lib; { 194 - description = "Blacksky Community Web Client"; 195 - # Placeholder, update with actual homepage if available. 196 - homepage = "https://github.com/blacksky-algorithms/blacksky.community"; 197 - # Placeholder, update with actual license if available. Assuming MIT for now. 198 - license = licenses.mit; 199 - # Placeholder, add actual maintainers. 200 - maintainers = with maintainers; [ ]; 201 - }; 202 - }; 203 - }
+41 -7
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"; 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 + buildFlags = [ "-mod=vendor" ]; 32 + 33 + preBuild = '' 34 + export HOME=$TMPDIR 35 + ''; 36 + 37 + meta = with lib; { 38 + description = "Go source code for Bluesky's atproto services"; 39 + homepage = "https://github.com/bluesky-social/indigo"; 40 + license = licenses.mit; 41 + maintainers = with maintainers; [ ]; 42 + }; 9 43 }
-84
pkgs/microcosm/default.nix
··· 1 - { pkgs, craneLib }: 2 - 3 - let 4 - src = pkgs.fetchFromGitHub { 5 - owner = "at-microcosm"; 6 - repo = "microcosm-rs"; 7 - rev = "b0a66a102261d0b4e8a90d34cec3421073a7b728"; 8 - sha256 = "sha256-swdAcsjRWnj9abmnrce5LzeKRK+LHm8RubCEIuk+53c="; 9 - }; 10 - 11 - crane-overrides = pkgs.callPackage ../../overlays/default.nix { }; 12 - 13 - commonEnv = { 14 - LIBCLANG_PATH = pkgs.lib.makeLibraryPath [ pkgs.llvmPackages.libclang.lib ]; 15 - OPENSSL_NO_VENDOR = "1"; 16 - OPENSSL_LIB_DIR = "${pkgs.lib.getLib pkgs.openssl}/lib"; 17 - OPENSSL_INCLUDE_DIR = "${pkgs.lib.getDev pkgs.openssl}/include"; 18 - BINDGEN_EXTRA_CLANG_ARGS = pkgs.lib.concatStringsSep " " (["-I${pkgs.llvmPackages.libclang.lib}/lib/clang/${pkgs.lib.versions.major pkgs.llvmPackages.libclang.version}/include"] ++ pkgs.lib.optional pkgs.stdenv.isLinux "-I${pkgs.glibc.dev}"); 19 - ZSTD_SYS_USE_PKG_CONFIG = "1"; 20 - CC = "${pkgs.llvmPackages.clang}/bin/clang"; 21 - CXX = "${pkgs.llvmPackages.clang}/bin/clang++"; 22 - PKG_CONFIG_PATH = "${pkgs.zstd.dev}/lib/pkgconfig:${pkgs.lz4.dev}/lib/pkgconfig"; 23 - }; 24 - 25 - nativeInputs = with pkgs; [ 26 - pkg-config 27 - perl 28 - ]; 29 - 30 - buildInputs = with pkgs; [ 31 - zstd 32 - lz4 33 - rocksdb 34 - openssl 35 - ]; 36 - 37 - cargoArtifacts = craneLib.buildDepsOnly { 38 - inherit src; 39 - pname = "microcosm-rs-deps"; 40 - nativeBuildInputs = nativeInputs; 41 - buildInputs = buildInputs; 42 - env = commonEnv; 43 - overrides = crane-overrides; 44 - }; 45 - 46 - members = [ 47 - "links" 48 - "constellation" 49 - "jetstream" 50 - "ufos" 51 - "ufos/fuzz" 52 - "spacedust" 53 - "who-am-i" 54 - "slingshot" 55 - "quasar" 56 - "pocket" 57 - "reflector" 58 - ]; 59 - 60 - buildPackage = member: 61 - let 62 - packageName = if member == "ufos/fuzz" then "ufos-fuzz" else member; 63 - in 64 - craneLib.buildPackage { 65 - inherit src cargoArtifacts; 66 - pname = packageName; 67 - version = "0.1.0"; 68 - cargoExtraArgs = "--package ${packageName}"; 69 - nativeBuildInputs = nativeInputs; 70 - buildInputs = buildInputs ++ (pkgs.lib.optional (member == "pocket") pkgs.sqlite); 71 - env = commonEnv; 72 - }; 73 - 74 - packages = pkgs.lib.genAttrs members (member: buildPackage member); 75 - 76 - in 77 - packages // { 78 - default = pkgs.linkFarm "microcosm-rs" (pkgs.lib.mapAttrsToList (name: value: 79 - let 80 - linkName = if name == "ufos/fuzz" then "ufos-fuzz" else name; 81 - in 82 - { name = linkName; path = value; } 83 - ) packages); 84 - }