Seafile minimal config working, now modularise and configure.

This commit is contained in:
Jurn Wubben 2025-03-30 11:25:45 +00:00
parent c3bc0cc509
commit 104a592b11
4 changed files with 48 additions and 1 deletions

17
flake.lock generated
View file

@ -537,6 +537,22 @@
"url": "https://github.com/NixOS/nixpkgs/archive/072a6db25e947df2f31aab9eccd0ab75d5b2da11.tar.gz"
}
},
"nixpkgs-stable": {
"locked": {
"lastModified": 1743161759,
"narHash": "sha256-AJJy0SKtqLld9JPYi/yvI2P6qCNpcjExHuniZbRSklk=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "873f4b2202bdac3845fa5ae294cfa2748ef0667e",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-24.11-small",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1737003892,
@ -702,6 +718,7 @@
"hm": "hm",
"nixcord": "nixcord",
"nixpkgs": "nixpkgs_4",
"nixpkgs-stable": "nixpkgs-stable",
"nvf": "nvf",
"somcli": "somcli",
"stylix": "stylix"

View file

@ -29,6 +29,7 @@
inputs = {
# Nixpkgs and other core shit
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable-small"; # build error unrelated to config.
nixpkgs-stable.url = "github:nixos/nixpkgs/nixos-24.11-small"; # build error unrelated to config.
flake-parts.url = "github:hercules-ci/flake-parts";
hm = {

View file

@ -1,4 +1,4 @@
{lib, ...}: {
imports = [./caddy.nix ./transfer-sh.nix];
imports = [./caddy.nix ./transfer-sh.nix ./seafile.nix];
options.niksos.server = lib.mkEnableOption "server servcies (such as caddy)."; #TODO: per service option.
}

29
system/server/seafile.nix Normal file
View file

@ -0,0 +1,29 @@
{inputs, pkgs, ...}: {
services.seafile = {
enable = true;
seahubPackage = inputs.nixpkgs-stable.legacyPackages.${pkgs.system}.seahub;
adminEmail = "jurnwubben@gmail.com";
initialAdminPassword = "test";
ccnetSettings.General.SERVICE_URL = "https://files.jsw.tf";
seafileSettings = {
fileserver = {
host = "unix:/run/seafile/server.sock";
};
};
};
services.caddy.virtualHosts."files.jsw.tf" = {
# serverAliases = ["www.share.jsw.tf"];
extraConfig = ''
handle_path /seafhttp/* {
reverse_proxy * unix//run/seafile/server.sock
}
handle_path /* {
reverse_proxy * unix//run/seahub/gunicorn.sock
}
'';
};
}