From 4363c646190b44cc97d36d1a6623b70a912aee97 Mon Sep 17 00:00:00 2001 From: wi11-holdsworth <83637728+wi11-holdsworth@users.noreply.github.com> Date: Tue, 29 Jul 2025 12:04:26 +1000 Subject: [PATCH] replace webdav with copyparty --- flake.lock | 62 +++++++++++++++-- flake.nix | 3 +- modules/nixos/bundles/server.nix | 2 +- modules/nixos/features/copyparty.nix | 68 +++++++++++++++++++ modules/nixos/features/homepage-dashboard.nix | 7 ++ modules/nixos/features/webdav.nix | 47 ------------- secrets/copyparty-will.age | 8 +++ secrets/secrets.nix | 1 + 8 files changed, 143 insertions(+), 55 deletions(-) create mode 100644 modules/nixos/features/copyparty.nix delete mode 100644 modules/nixos/features/webdav.nix create mode 100644 secrets/copyparty-will.age diff --git a/flake.lock b/flake.lock index 9f24173..878a8a1 100644 --- a/flake.lock +++ b/flake.lock @@ -23,6 +23,25 @@ "type": "github" } }, + "copyparty": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + }, + "locked": { + "lastModified": 1753748190, + "narHash": "sha256-uHWUCf/2BAv0SOvgD4UnQhSMnEX3PV4m/aB07Tj5IU4=", + "owner": "9001", + "repo": "copyparty", + "rev": "4915b14be191bca9a91f942073650fee27b3231b", + "type": "github" + }, + "original": { + "owner": "9001", + "repo": "copyparty", + "type": "github" + } + }, "darwin": { "inputs": { "nixpkgs": [ @@ -67,6 +86,21 @@ } }, "flake-utils": { + "locked": { + "lastModified": 1678901627, + "narHash": "sha256-U02riOqrKKzwjsxc/400XnElV+UtPUQWpANPlyazjH0=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "93a2b84fc4b70d9e089d029deacc3583435c2ed6", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_2": { "inputs": { "systems": "systems_2" }, @@ -84,7 +118,7 @@ "type": "github" } }, - "flake-utils_2": { + "flake-utils_3": { "inputs": { "systems": "systems_4" }, @@ -172,6 +206,21 @@ } }, "nixpkgs": { + "locked": { + "lastModified": 1748162331, + "narHash": "sha256-rqc2RKYTxP3tbjA+PB3VMRQNnjesrT0pEofXQTrMsS8=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "7c43f080a7f28b2774f3b3f43234ca11661bf334", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "ref": "nixos-25.05", + "type": "indirect" + } + }, + "nixpkgs_2": { "locked": { "lastModified": 1753250450, "narHash": "sha256-i+CQV2rPmP8wHxj0aq4siYyohHwVlsh40kV89f3nw1s=", @@ -187,7 +236,7 @@ "type": "github" } }, - "nixpkgs_2": { + "nixpkgs_3": { "locked": { "lastModified": 1682134069, "narHash": "sha256-TnI/ZXSmRxQDt2sjRYK/8j8iha4B4zP2cnQCZZ3vp7k=", @@ -226,7 +275,7 @@ }, "nuschtosSearch": { "inputs": { - "flake-utils": "flake-utils", + "flake-utils": "flake-utils_2", "ixx": "ixx", "nixpkgs": [ "nixvim", @@ -250,8 +299,9 @@ "root": { "inputs": { "agenix": "agenix", + "copyparty": "copyparty", "home-manager": "home-manager_2", - "nixpkgs": "nixpkgs", + "nixpkgs": "nixpkgs_2", "nixvim": "nixvim", "vscode-server": "vscode-server" } @@ -318,8 +368,8 @@ }, "vscode-server": { "inputs": { - "flake-utils": "flake-utils_2", - "nixpkgs": "nixpkgs_2" + "flake-utils": "flake-utils_3", + "nixpkgs": "nixpkgs_3" }, "locked": { "lastModified": 1750353031, diff --git a/flake.nix b/flake.nix index a24ba54..62c4f44 100644 --- a/flake.nix +++ b/flake.nix @@ -15,11 +15,12 @@ url = "github:ryantm/agenix"; inputs.nixpkgs.follows = "nixpkgs"; }; + copyparty.url = "github:9001/copyparty"; vscode-server.url = "github:nix-community/nixos-vscode-server"; }; outputs = - { nixpkgs, agenix, ... }@inputs: + { nixpkgs, ... }@inputs: let commonSystem = { diff --git a/modules/nixos/bundles/server.nix b/modules/nixos/bundles/server.nix index 984920f..3ded3d4 100644 --- a/modules/nixos/bundles/server.nix +++ b/modules/nixos/bundles/server.nix @@ -5,6 +5,7 @@ in { config = lib.mkIf config.${feature}.enable { # couchdb.enable = true; + copyparty.enable = true; flaresolverr.enable = true; homepage-dashboard.enable = true; immich.enable = true; @@ -20,7 +21,6 @@ in qbittorrent.enable = true; vaultwarden.enable = true; vscode-server.enable = true; - webdav.enable = true; users.groups.media = {}; }; diff --git a/modules/nixos/features/copyparty.nix b/modules/nixos/features/copyparty.nix new file mode 100644 index 0000000..1a8dcf7 --- /dev/null +++ b/modules/nixos/features/copyparty.nix @@ -0,0 +1,68 @@ +{ + config, + lib, + inputs, + pkgs, + ... +}: +let + feature = "copyparty"; + port = "5000"; +in +{ + imports = [ inputs.copyparty.nixosModules.default ]; + + config = lib.mkIf config.${feature}.enable { + environment.systemPackages = [ pkgs.copyparty ]; + nixpkgs.overlays = [ inputs.copyparty.overlays.default ]; + + age.secrets."copyparty-will" = { + file = ../../../secrets/copyparty-will.age; + owner = "copyparty"; + }; + + services = { + # service + ${feature} = { + enable = true; + settings = { + z = true; + e2dsa = true; + e2ts = true; + e2vu = true; + p = lib.toInt port; + }; + + accounts = { + will = { + passwordFile = config.age.secrets.copyparty-will.path; + }; + }; + + volumes = { + "/" = { + path = "/srv/copyparty"; + access = { + r = "*"; + A = [ "will" ]; + }; + }; + }; + }; + + # reverse proxy + nginx = { + virtualHosts."${feature}.fi33.buzz" = { + forceSSL = true; + useACMEHost = "fi33.buzz"; + locations."/" = { + proxyPass = "http://localhost:${port}"; + # proxyWebsockets = true; + }; + }; + }; + }; + }; + + options.${feature}.enable = lib.mkEnableOption "enables ${feature}"; +} diff --git a/modules/nixos/features/homepage-dashboard.nix b/modules/nixos/features/homepage-dashboard.nix index d88510b..d9a18e2 100644 --- a/modules/nixos/features/homepage-dashboard.nix +++ b/modules/nixos/features/homepage-dashboard.nix @@ -165,6 +165,13 @@ in } { "Cloud Services" = [ + { + "copyparty" = { + "description" = "Cloud file manager"; + "icon" = "sh-copyparty.png"; + "href" = "https://copyparty.fi33.buzz/"; + }; + } { "CouchDB" = { "description" = "Obsidian sync database"; diff --git a/modules/nixos/features/webdav.nix b/modules/nixos/features/webdav.nix deleted file mode 100644 index 62ea793..0000000 --- a/modules/nixos/features/webdav.nix +++ /dev/null @@ -1,47 +0,0 @@ -{ - config, - lib, - ... -}: -let - feature = "webdav"; - port = "5000"; -in -{ - config = lib.mkIf config.${feature}.enable { - services = { - # service - ${feature} = { - enable = true; - settings = { - address = "127.0.0.1"; - port = lib.toInt port; - permissions = "R"; - directory = "/srv/webdav"; - modify = true; - users = [ - { - username = "admin"; - password = "{bcrypt}$2a$10$Buai6WtOhE7NoSNKNzcJ1OEJNFWyUzp6Y6b8i9pvdvIFNw8OaxCGm"; - permissions = "CRUD"; - } - ]; - }; - }; - - # reverse proxy - nginx = { - virtualHosts."${feature}.fi33.buzz" = { - forceSSL = true; - useACMEHost = "fi33.buzz"; - locations."/" = { - proxyPass = "http://localhost:${port}"; - # proxyWebsockets = true; - }; - }; - }; - }; - }; - - options.${feature}.enable = lib.mkEnableOption "enables ${feature}"; -} diff --git a/secrets/copyparty-will.age b/secrets/copyparty-will.age new file mode 100644 index 0000000..a13b55b --- /dev/null +++ b/secrets/copyparty-will.age @@ -0,0 +1,8 @@ +age-encryption.org/v1 +-> ssh-ed25519 LtK9yQ 4SIjyFmoPbalDVHZclX9MlACFNRC+f9GL6e3azRSj10 +vphCAvstVLmZibay6gXI1PZETwbtOkp/UcAj6ZWH+ig +-> ssh-ed25519 qLT+DQ DTtgAHqjF/Gal2vV003rD6b7QPhjVq6/7q0U5DhyBnY +r6an9YBH19zbO4Ihfj2rWkU4fkMAXJ1IQwvUJtyHEHg +--- f6vF7n2zj3SVt7xDmglO6J1uPYDN4FRO8OcPpODo6ko +|٨Q9!TW+t[ +h2b#]BI$K~cQ}g"e gx!Bh2` \ No newline at end of file diff --git a/secrets/secrets.nix b/secrets/secrets.nix index 1a3ff42..67f982d 100644 --- a/secrets/secrets.nix +++ b/secrets/secrets.nix @@ -10,6 +10,7 @@ in "api-miniflux.age".publicKeys = users; "borgbackup-server-offsite.age".publicKeys = users; "borgbackup-server-onsite.age".publicKeys = users; + "copyparty-will.age".publicKeys = users; "immich.age".publicKeys = users; "jellyfin.age".publicKeys = users; "jellyseerr.age".publicKeys = users;