1
0
Fork 0

Compare commits

..

No commits in common. "776ee79f4fb8cec0f27c1a03e2bd7975ae10fe4d" and "89e9f95ba9daae8fe359022d74de1b84c3e312f7" have entirely different histories.

4 changed files with 2 additions and 76 deletions

View file

@ -20,7 +20,6 @@ let
# List of subdomains to add to the TLS certificate
subdomains = with config.secrets.services; [
dav.url
forgejo.url
gremlin-lab.url
jellyfin.url
@ -213,12 +212,6 @@ in
ram = 4096;
};
};
webdav = {
enable = false;
home = "${services-root}/webdav";
url = config.secrets.services.webdav.url;
users = config.secrets.services.webdav.users;
};
};
users.aires = {

View file

@ -14,7 +14,7 @@ in
system.stateVersion = stateVersion;
networking.hostName = hostName;
custom-fonts.Freight-Pro.enable = config.aux.system.users.gremlin.enable;
custom-fonts.Freight-Pro.enable = true;
aux.system = {
apps = {
@ -42,6 +42,7 @@ in
gpu.amd.enable = true;
packages = with pkgs; [
boinc # Boinc client
keepassxc # Use native instead of Flatpak due to weird performance issues
];

Binary file not shown.

View file

@ -1,68 +0,0 @@
{
pkgs,
config,
lib,
...
}:
let
cfg = config.aux.system.services.webdav;
port = 6065; # Internal port to run the server on
in
{
options = {
aux.system.services.webdav = {
enable = lib.mkEnableOption "Enables Webdav server.";
home = lib.mkOption {
default = "/var/lib/webdav";
type = lib.types.str;
description = "Where to store Webdav's files";
example = "/home/webdav";
};
url = lib.mkOption {
default = "";
type = lib.types.str;
description = "The complete URL where Webdav is hosted.";
example = "https://dav.example.com";
};
users = lib.mkOption {
default = [ ];
type = lib.types.listOf lib.types.attrs;
description = "List of user accounts to create.";
example = lib.literalExpression "[ { username = \"user\"; password = \"pass\"; } ]";
};
};
};
config = lib.mkIf cfg.enable {
services = {
webdav = {
enable = true;
settings = {
address = "127.0.0.1";
port = port;
scope = cfg.home;
users = cfg.users;
};
};
nginx.virtualHosts."${cfg.url}" = {
useACMEHost = pkgs.util.getDomainFromURL cfg.url;
forceSSL = true;
locations."/".extraConfig = ''
proxy_pass http://127.0.0.1:${builtins.toString port};
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header REMOTE-HOST $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_redirect off;
'';
};
};
systemd.services = {
webdav.unitConfig.RequiresMountsFor = cfg.home;
nginx.wants = [ config.systemd.services.webdav.name ];
};
};
}