Skip to content

Commit

Permalink
🔧 (service): pingvin-share
Browse files Browse the repository at this point in the history
  • Loading branch information
elythh committed Jan 23, 2025
1 parent 91634b7 commit cbd27dc
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 0 deletions.
1 change: 1 addition & 0 deletions hosts/mithrix/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ in
paperless.enable = true;
#radicle.enable = true;
soft-serve.enable = true;
pingvin-share.enable = true;
};
};
tailscale.enable = true;
Expand Down
1 change: 1 addition & 0 deletions modules/nixos/opt/services/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
./immich.nix
./kanata.nix
./paperless.nix
./pingvin-share.nix
./radicle.nix
./soft-serve.nix
./vikunja.nix
Expand Down
56 changes: 56 additions & 0 deletions modules/nixos/opt/services/pingvin-share.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{ config, lib, ... }:
let
inherit (lib)
mkIf
mkOption
types
mkEnableOption
;

hostname = "share.elyth.xyz";
cfg = config.opt.services.pingvin-share;
in
{
options.opt.services.pingvin-share = {
enable = mkEnableOption "pingvin-share";
hostname = mkOption {
type = types.str;
default = "0.0.0.0";
};
frontPort = mkOption {
type = types.int;
default = 2323;
};
backPort = mkOption {
type = types.int;
default = 2424;
};
};

config = mkIf cfg.enable {

services = {
pingvin-share = {
enable = true;
frontend = {
port = cfg.frontPort;
};
backend = {
port = cfg.backPort;
};
dataDir = "/media/share";
};
cloudflared.tunnels = {
"9f52eb17-9286-4b74-8526-28094e48f79f" = {
credentialsFile = config.sops.secrets.cloudflared-tunnel-creds.path;
default = "http_status:404";
ingress = {
${hostname} = {
service = "http://localhost:${builtins.toString cfg.frontPort}";
};
};
};
};
};
};
}

0 comments on commit cbd27dc

Please sign in to comment.