commit
7fdab26712
4 changed files with 59 additions and 1 deletions
17
flake.lock
generated
17
flake.lock
generated
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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 = {
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
}
|
||||
|
|
|
|||
40
system/server/seafile.nix
Normal file
40
system/server/seafile.nix
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
{config, inputs, pkgs, ...}:{
|
||||
services.seafile = {
|
||||
enable = config.niksos.server;
|
||||
seahubPackage = inputs.nixpkgs-stable.legacyPackages.${pkgs.system}.seahub;
|
||||
|
||||
adminEmail = "jurnwubben@gmail.com";
|
||||
initialAdminPassword = "ChangeMeTheFuckNow!";
|
||||
|
||||
gc.enable = true;
|
||||
|
||||
ccnetSettings.General.SERVICE_URL = "https://files.jsw.tf";
|
||||
seahubExtraConf = ''
|
||||
ALLOWED_HOSTS = ['.files.jsw.tf']
|
||||
CSRF_COOKIE_SECURE = True
|
||||
CSRF_COOKIE_SAMESITE = 'Strict'
|
||||
CSRF_TRUSTED_ORIGINS = ['https://files.jsw.tf', 'https://www.files.jsw.tf']
|
||||
'';
|
||||
seafileSettings = {
|
||||
quota.default = 30;
|
||||
history.keep_days = 40;
|
||||
library_trash.expire_days = 14;
|
||||
fileserver = {
|
||||
host = "unix:/run/seafile/server.sock";
|
||||
web_token_expire_time = 14400; # 4 hours
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
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
|
||||
}
|
||||
'';
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue