This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

neoprism: add opencrow matrix bot

+141 -3
+46 -3
flake.lock
··· 491 491 "type": "github" 492 492 } 493 493 }, 494 - "rogue-talk": { 494 + "opencrow": { 495 495 "inputs": { 496 496 "nixpkgs": [ 497 497 "nixpkgs" 498 498 ], 499 499 "treefmt-nix": "treefmt-nix_5" 500 + }, 501 + "locked": { 502 + "lastModified": 1771622489, 503 + "narHash": "sha256-CGAS5ISs+h6GNQwaOLycfbcFRkN0legi/hdDov4Obfk=", 504 + "owner": "pinpox", 505 + "repo": "opencrow", 506 + "rev": "9ec2d17e6c9d45b22b9cca3174b6b1a75758d8f6", 507 + "type": "github" 508 + }, 509 + "original": { 510 + "owner": "pinpox", 511 + "repo": "opencrow", 512 + "type": "github" 513 + } 514 + }, 515 + "rogue-talk": { 516 + "inputs": { 517 + "nixpkgs": [ 518 + "nixpkgs" 519 + ], 520 + "treefmt-nix": "treefmt-nix_6" 500 521 }, 501 522 "locked": { 502 523 "lastModified": 1770248736, ··· 527 548 "nixos-hardware": "nixos-hardware", 528 549 "nixpkgs": "nixpkgs", 529 550 "nixvim": "nixvim", 551 + "opencrow": "opencrow", 530 552 "rogue-talk": "rogue-talk", 531 553 "spora": "spora", 532 554 "stockholm": "stockholm", 533 - "treefmt-nix": "treefmt-nix_6", 555 + "treefmt-nix": "treefmt-nix_7", 534 556 "wrappers": "wrappers" 535 557 } 536 558 }, ··· 746 768 "treefmt-nix_5": { 747 769 "inputs": { 748 770 "nixpkgs": [ 771 + "opencrow", 772 + "nixpkgs" 773 + ] 774 + }, 775 + "locked": { 776 + "lastModified": 1770228511, 777 + "narHash": "sha256-wQ6NJSuFqAEmIg2VMnLdCnUc0b7vslUohqqGGD+Fyxk=", 778 + "owner": "numtide", 779 + "repo": "treefmt-nix", 780 + "rev": "337a4fe074be1042a35086f15481d763b8ddc0e7", 781 + "type": "github" 782 + }, 783 + "original": { 784 + "owner": "numtide", 785 + "repo": "treefmt-nix", 786 + "type": "github" 787 + } 788 + }, 789 + "treefmt-nix_6": { 790 + "inputs": { 791 + "nixpkgs": [ 749 792 "rogue-talk", 750 793 "nixpkgs" 751 794 ] ··· 764 807 "type": "github" 765 808 } 766 809 }, 767 - "treefmt-nix_6": { 810 + "treefmt-nix_7": { 768 811 "inputs": { 769 812 "nixpkgs": [ 770 813 "nixpkgs"
+3
flake.nix
··· 69 69 wrappers.url = "github:lassulus/wrappers"; 70 70 # wrappers.url = "git+file:/home/lass/src/wrappers"; 71 71 wrappers.inputs.nixpkgs.follows = "nixpkgs"; 72 + 73 + opencrow.url = "github:pinpox/opencrow"; 74 + opencrow.inputs.nixpkgs.follows = "nixpkgs"; 72 75 }; 73 76 74 77 outputs =
+89
2configs/opencrow.nix
··· 1 + { self, config, pkgs, ... }: 2 + let 3 + opencrow = self.inputs.opencrow.packages.${pkgs.system}.opencrow; 4 + pi = self.inputs.llm-agents.packages.${pkgs.system}.pi; 5 + in 6 + { 7 + users.users.bot = { 8 + isNormalUser = true; 9 + home = "/home/bot"; 10 + createHome = true; 11 + group = "users"; 12 + useDefaultShell = true; 13 + openssh.authorizedKeys.keys = [ 14 + self.keys.ssh.barnacle.public 15 + self.keys.ssh.yubi_pgp.public 16 + self.keys.ssh.yubi1.public 17 + self.keys.ssh.yubi2.public 18 + self.keys.ssh.solo2.public 19 + self.keys.ssh.xerxes.public 20 + self.keys.ssh.massulus.public 21 + ]; 22 + packages = [ 23 + opencrow 24 + pi 25 + pkgs.curl 26 + pkgs.jq 27 + pkgs.lynx 28 + ]; 29 + }; 30 + 31 + clan.core.vars.generators.opencrow = { 32 + prompts.matrix-access-token = { 33 + description = "Matrix access token for @opencrow:lassul.us - register via synapse admin API using the registration_shared_secret"; 34 + type = "hidden"; 35 + }; 36 + files."opencrow.env" = { }; 37 + script = '' 38 + cat > "$out/opencrow.env" << EOF 39 + OPENCROW_MATRIX_ACCESS_TOKEN=$(cat $prompts/matrix-access-token) 40 + EOF 41 + ''; 42 + }; 43 + 44 + systemd.services.opencrow = { 45 + description = "OpenCrow Matrix Bot"; 46 + wantedBy = [ "multi-user.target" ]; 47 + after = [ "network-online.target" ]; 48 + wants = [ "network-online.target" ]; 49 + 50 + path = [ 51 + opencrow 52 + pi 53 + pkgs.bash 54 + pkgs.coreutils 55 + pkgs.curl 56 + pkgs.jq 57 + pkgs.lynx 58 + ]; 59 + 60 + environment = { 61 + OPENCROW_MATRIX_HOMESERVER = "https://matrix.lassul.us"; 62 + OPENCROW_ALLOWED_USERS = "@lassulus:lassul.us"; 63 + OPENCROW_MATRIX_USER_ID = "@opencrow:lassul.us"; 64 + OPENCROW_MATRIX_DEVICE_ID = "AYBPKDHIDV"; 65 + OPENCROW_PI_SESSION_DIR = "/home/bot/opencrow/sessions"; 66 + OPENCROW_PI_WORKING_DIR = "/home/bot/opencrow"; 67 + OPENCROW_PI_SKILLS = "${opencrow}/share/opencrow/skills/web"; 68 + OPENCROW_SOUL_FILE = "${opencrow}/share/opencrow/SOUL.md"; 69 + PI_CODING_AGENT_DIR = "/home/bot/opencrow/pi-agent"; 70 + }; 71 + 72 + serviceConfig = { 73 + EnvironmentFile = config.clan.core.vars.generators.opencrow.files."opencrow.env".path; 74 + ExecStart = "${opencrow}/bin/opencrow"; 75 + Restart = "on-failure"; 76 + RestartSec = 10; 77 + User = "bot"; 78 + Group = "users"; 79 + WorkingDirectory = "/home/bot/opencrow"; 80 + }; 81 + }; 82 + 83 + # ensure working directory exists 84 + systemd.tmpfiles.rules = [ 85 + "d /home/bot/opencrow 0750 bot users -" 86 + "d /home/bot/opencrow/sessions 0750 bot users -" 87 + "d /home/bot/opencrow/pi-agent 0750 bot users -" 88 + ]; 89 + }
+3
machines/neoprism/config.nix
··· 54 54 55 55 # download user 56 56 ../../2configs/download-user.nix 57 + 58 + # opencrow matrix bot 59 + ../../2configs/opencrow.nix 57 60 ]; 58 61 59 62 krebs.build.host = config.krebs.hosts.neoprism;