diff --git a/flake.lock b/flake.lock index 25f1347..430c0c1 100644 --- a/flake.lock +++ b/flake.lock @@ -712,6 +712,29 @@ "type": "github" } }, + "opencrow": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ], + "treefmt-nix": [ + "treefmt-nix" + ] + }, + "locked": { + "lastModified": 1771337567, + "narHash": "sha256-DiH3hGzC7z6qv39zuFCrMrKDTKdtsN+z/OorsbBdJaQ=", + "owner": "pinpox", + "repo": "opencrow", + "rev": "8da71c7d1d04e27ffb5aade99f67e591d52c30c4", + "type": "github" + }, + "original": { + "owner": "pinpox", + "repo": "opencrow", + "type": "github" + } + }, "retiolum": { "locked": { "lastModified": 1756302470, @@ -745,6 +768,7 @@ "nixpkgs-old": "nixpkgs-old", "nixpkgs-unstable": "nixpkgs-unstable", "nur": "nur", + "opencrow": "opencrow", "retiolum": "retiolum", "scripts": "scripts", "stockholm": "stockholm", diff --git a/flake.nix b/flake.nix index d8ac97a..d37f7e3 100644 --- a/flake.nix +++ b/flake.nix @@ -46,6 +46,8 @@ agenix.inputs.home-manager.follows = "home-manager"; + opencrow.inputs.treefmt-nix.follows = "treefmt-nix"; + agenix.inputs.nixpkgs.follows = "nixpkgs"; autorenkalender.inputs.nixpkgs.follows = "nixpkgs"; home-manager.inputs.nixpkgs.follows = "nixpkgs"; @@ -284,6 +286,7 @@ }; # packaged from inputs + opencrow = opencrow.packages.${prev.stdenv.hostPlatform.system}.opencrow; wetter = wetter.packages.${prev.stdenv.hostPlatform.system}.wetter; agenix = agenix.packages.${prev.stdenv.hostPlatform.system}.default; pun-sort-api = scripts.packages.${prev.stdenv.hostPlatform.system}.pun-sort-api; diff --git a/packages/pi.nix b/packages/pi.nix index b4cd67a..a4eef3a 100644 --- a/packages/pi.nix +++ b/packages/pi.nix @@ -18,7 +18,7 @@ let ]; outputHashMode = "recursive"; outputHashAlgo = "sha256"; - outputHash = "sha256-hfYl0Slxg3nuN6KTtvpWW0QUxtg3JRE0n9N7rIXBTOc="; + outputHash = "sha256-ruCukrbH89/uZHhxYSmrcs5NUi2ZG8nuwTEuJKHP2rw="; impureEnvVars = [ "http_proxy" "https_proxy" diff --git a/secrets b/secrets index 2309c34..94998bb 160000 --- a/secrets +++ b/secrets @@ -1 +1 @@ -Subproject commit 2309c34eb61977f73691349668738fb67871d78a +Subproject commit 94998bbbe0a7c6b7b61e945946335a69e8386357 diff --git a/systems/ful/opencrow.nix b/systems/ful/opencrow.nix index e16d213..a781b92 100644 --- a/systems/ful/opencrow.nix +++ b/systems/ful/opencrow.nix @@ -11,37 +11,72 @@ opencrow-soul = { file = ../../secrets/opencrow-soul.age; }; + opencrow-gemini-key = { + file = ../../secrets/opencrow-gemini-key.age; + }; + opencrow-openrouter-key = { + file = ../../secrets/opencrow-openrouter-key.age; + }; }; + environment.systemPackages = [ + pkgs.pi + ]; + services.opencrow = { enable = true; - extraPackages = [ pkgs.pi pkgs.nix ]; + package = pkgs.opencrow; + + extraPackages = [ + pkgs.pi + pkgs.nix + ]; environmentFiles = [ config.age.secrets.opencrow-matrix-token.path + config.age.secrets.opencrow-openrouter-key.path + config.age.secrets.opencrow-gemini-key.path ]; - extraBindMounts."/run/secrets/opencrow-soul" = { + extraBindMounts."/run/opencrow/SOUL.md" = { hostPath = config.age.secrets.opencrow-soul.path; isReadOnly = true; }; - extraBindMounts."/nix/var/nix/daemon-socket" = { - hostPath = "/nix/var/nix/daemon-socket"; - isReadOnly = false; - }; - environment = { - PI_PERMISSION_LEVEL= "high"; + NIX_REMOTE = "daemon"; + + PI_PERMISSION_LEVEL = "high"; OPENCROW_MATRIX_HOMESERVER = "https://matrix.4d2.org"; OPENCROW_MATRIX_USER_ID = "@fable:4d2.org"; - OPENCROW_PI_PROVIDER = "github-copilot"; - OPENCROW_PI_MODEL = "gemini-3-flash-preview"; - OPENCROW_SOUL_FILE = "/run/secrets/opencrow-soul"; + OPENCROW_SOUL_FILE = "/run/opencrow/SOUL.md"; + OPENCROW_HEARTBEAT_INTERVAL = "2h"; + + # end of the month + OPENCROW_PI_PROVIDER = "openrouter"; + OPENCROW_PI_MODEL = "stepfun/step-3.5-flash:free"; + # OPENCROW_PI_PROVIDER = "google"; + # OPENCROW_PI_MODEL = "gemini-2.0-flash"; + + # beginning of the month + # OPENCROW_PI_PROVIDER = "github-copilot"; + # OPENCROW_PI_MODEL = "claude-opus-4.6"; }; }; + containers.opencrow.config = { + nix.settings.experimental-features = [ + "flakes" + "nix-command" + ]; + }; + + nix.settings.experimental-features = [ + "flakes" + "nix-command" + ]; + services.restic.backups.niveum.paths = [ "/var/lib/opencrow" ];