aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/services/nixos/copyparty.nix48
-rw-r--r--modules/services/nixos/default.nix2
-rw-r--r--modules/services/options.nix7
3 files changed, 56 insertions, 1 deletions
diff --git a/modules/services/nixos/copyparty.nix b/modules/services/nixos/copyparty.nix
new file mode 100644
index 0000000..400338f
--- /dev/null
+++ b/modules/services/nixos/copyparty.nix
@@ -0,0 +1,48 @@
+{
+ config,
+ lib,
+ pkgs,
+ inputs,
+ ...
+}: let
+ cfg = config.collinux.services.copyparty;
+in {
+ imports = [
+ inputs.copyparty.nixosModules.default
+ (import ./mkCaddyCfg.nix cfg)
+ ];
+
+ config = lib.mkIf cfg.enable {
+ services.copyparty = {
+ enable = true;
+
+ settings = {
+ i = "0.0.0.0";
+ p = [cfg.port];
+ chpw = true;
+ rproxy = "1";
+ usernames = true;
+ };
+
+ accounts = {
+ collin = {
+ passwordFile = toString <| pkgs.writeText "default-pw" "admin"; # not the actual password anymore
+ };
+ };
+ volumes = {
+ "/" = {
+ path = "/media";
+ access = {
+ r = "*";
+ rw = ["collin"];
+ };
+
+ flags = {
+ scan = 60;
+ chmod_f = 777;
+ };
+ };
+ };
+ };
+ };
+}
diff --git a/modules/services/nixos/default.nix b/modules/services/nixos/default.nix
index 234a712..1160c90 100644
--- a/modules/services/nixos/default.nix
+++ b/modules/services/nixos/default.nix
@@ -7,5 +7,7 @@
# ./jellyfin.nix
./caddy.nix
./adguard.nix
+
+ ./copyparty.nix
];
}
diff --git a/modules/services/options.nix b/modules/services/options.nix
index 880206f..ef9f57f 100644
--- a/modules/services/options.nix
+++ b/modules/services/options.nix
@@ -4,7 +4,7 @@
...
}: let
inherit (lib) mkOption mkEnableOption;
- inherit ((my-lib {inherit lib;}).netTypes) ipAddr;
+ inherit (my-lib.netTypes {inherit lib;}) ipAddr;
selfhostOptions = {
service_name,
@@ -77,6 +77,11 @@ in {
};
};
+ copyparty = selfhostOptions {
+ service_name = "copyparty";
+ default_port = 8099;
+ };
+
headscale = selfhostOptions {
service_name = "headscale";
default_port = 8080;