From df2640d1384fc2d3ce2f509ee67f9d8538c47a14 Mon Sep 17 00:00:00 2001 From: chayleaf Date: Mon, 27 Nov 2023 00:20:43 +0700 Subject: [PATCH] home: add coop-ofd --- flake.lock | 66 ++++++++++++++++++++++++++++++++++-- flake.nix | 7 ++++ system/hosts/server/home.nix | 7 ++++ 3 files changed, 77 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index 0e4d085..69a7c74 100644 --- a/flake.lock +++ b/flake.lock @@ -16,6 +16,49 @@ "type": "gitlab" } }, + "coop-ofd": { + "inputs": { + "crane": "crane", + "flake-compat": "flake-compat", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1701018061, + "narHash": "sha256-qvDuKQSzNtoODLcms/0xczHzE5FPBcPJI+aXQ+Eqw/M=", + "owner": "chayleaf", + "repo": "coop-ofd", + "rev": "fbc3fde3090962ae5e9a5669dab28dbc89dd16a0", + "type": "github" + }, + "original": { + "owner": "chayleaf", + "repo": "coop-ofd", + "type": "github" + } + }, + "crane": { + "inputs": { + "nixpkgs": [ + "coop-ofd", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1700327093, + "narHash": "sha256-OgYvlBABxJYWhZ/HBd0bPVcIEkT+xDhDCpRYqtVhYWY=", + "owner": "ipetkov", + "repo": "crane", + "rev": "ae7cd510e508ee03d792005c2f1c0a3ff25ecb80", + "type": "github" + }, + "original": { + "owner": "ipetkov", + "repo": "crane", + "type": "github" + } + }, "flake-compat": { "flake": false, "locked": { @@ -49,6 +92,22 @@ } }, "flake-compat_3": { + "flake": false, + "locked": { + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-compat_4": { "flake": false, "locked": { "lastModified": 1668681692, @@ -137,7 +196,7 @@ }, "maubot": { "inputs": { - "flake-compat": "flake-compat_2", + "flake-compat": "flake-compat_3", "nixpkgs": [ "nixpkgs" ] @@ -212,7 +271,7 @@ "nixos-mailserver": { "inputs": { "blobs": "blobs", - "flake-compat": "flake-compat_3", + "flake-compat": "flake-compat_4", "nixpkgs": [ "nixpkgs" ], @@ -348,7 +407,8 @@ }, "root": { "inputs": { - "flake-compat": "flake-compat", + "coop-ofd": "coop-ofd", + "flake-compat": "flake-compat_2", "home-manager": "home-manager", "impermanence": "impermanence", "maubot": "maubot", diff --git a/flake.nix b/flake.nix index 1c4e3a2..7b5f714 100644 --- a/flake.nix +++ b/flake.nix @@ -17,6 +17,10 @@ url = "github:oxalica/rust-overlay"; inputs.nixpkgs.follows = "nixpkgs"; }; + coop-ofd = { + url = "github:chayleaf/coop-ofd"; + inputs.nixpkgs.follows = "nixpkgs"; + }; home-manager = { url = "github:nix-community/home-manager"; inputs.nixpkgs.follows = "nixpkgs"; @@ -57,6 +61,7 @@ outputs = inputs@ { self + , coop-ofd , nixpkgs , nixos-hardware , mobile-nixos @@ -76,6 +81,7 @@ devNft = false; devNixRt = false; devMaubot = false; + devCoopOfd = false; # IRL-related stuff I'd rather not put into git priv = if builtins.pathExists ./private.nix then (import ./private.nix { }) @@ -154,6 +160,7 @@ nixos-mailserver.nixosModules.default ./system/devices/radxa-rock5a-server.nix (if devMaubot then import /${devPath}/maubot.nix/module else maubot.nixosModules.default) + (if devCoopOfd then import /${devPath}/coop-ofd else coop-ofd).nixosModules.default ./system/modules/scanservjs.nix ]; }; diff --git a/system/hosts/server/home.nix b/system/hosts/server/home.nix index bc6b67b..0ef7e06 100644 --- a/system/hosts/server/home.nix +++ b/system/hosts/server/home.nix @@ -42,6 +42,10 @@ in { # services.keycloak.plugins = [ pkgs.keycloak.plugins.keycloak-metrics-spi ]; services.keycloak.settings.metrics-enabled = true; + services.coop-ofd = { + enable = true; + config.listener = "127.0.0.1:25783"; + }; services.nginx.virtualHosts."home.${cfg.domainName}" = { quic = true; enableACME = true; @@ -65,6 +69,9 @@ in { proxyPass = "http://127.0.0.1:631/"; proxyWebsockets = true; }; + locations."/money/" = { + proxyPass = "http://${config.services.coop-ofd.config.listener}/"; + }; }; services.nginx.virtualHosts."hydra.${cfg.domainName}" = { quic = true;