Skip to content

Commit

Permalink
✨ (services): soft-serve
Browse files Browse the repository at this point in the history
  • Loading branch information
elythh committed Sep 30, 2024
1 parent 6578a8e commit 0d40402
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 4 deletions.
3 changes: 2 additions & 1 deletion hosts/mithrix/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ in
vikunja.enable = true;
glance.enable = true;
paperless.enable = true;
radicle.enable = true;
#radicle.enable = true;
soft-serve.enable = true;
};
};
tailscale.enable = true;
Expand Down
7 changes: 4 additions & 3 deletions modules/nixos/opt/services/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@
imports = [
./cloudflared-tunnel.nix
./glance.nix
./xserver.nix
./kanata.nix
./immich.nix
./radicle.nix
./kanata.nix
./paperless.nix
./radicle.nix
./soft-serve.nix
./vikunja.nix
./xserver.nix
./your_spotify.nix
];
config = {
Expand Down
56 changes: 56 additions & 0 deletions modules/nixos/opt/services/soft-serve.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{ config, lib, ... }:
let
inherit (lib)
mkIf
mkOption
types
mkEnableOption
;

host = "git.elyth.xyz";
cfg = config.opt.services.soft-serve;
in
{
options.opt.services.soft-serve = {
enable = mkEnableOption "soft-serve";
host = mkOption {
type = types.str;
default = "0.0.0.0";
};
port = mkOption {
type = types.int;
default = 9999;
};
};

config = mkIf cfg.enable {

services = {
soft-serve = {
enable = true;
settings = {
name = "elyth's repos";
log_format = "text";
ssh = {
listen_addr = ":${builtins.toString cfg.port}";
public_url = "ssh://${cfg.host}:${builtins.toString cfg.port}";
max_timeout = 30;
idle_timeout = 120;
};
stats.listen_addr = ":${builtins.toString cfg.port}";
};
};
cloudflared.tunnels = {
"9f52eb17-9286-4b74-8526-28094e48f79f" = {
credentialsFile = config.sops.secrets.cloudflared-tunnel-creds.path;
default = "http_status:404";
ingress = {
${host} = {
service = "ssh://localhost:${builtins.toString cfg.port}";
};
};
};
};
};
};
}

0 comments on commit 0d40402

Please sign in to comment.