mirror of
https://github.com/CHN-beta/nixos.git
synced 2024-10-23 15:29:10 +08:00
28 lines
744 B
Nix
28 lines
744 B
Nix
inputs:
|
|
{
|
|
options.nixos.services.nginx.applications.webdav = let inherit (inputs.lib) mkOption types; in
|
|
{
|
|
enable = mkOption { type = types.bool; default = false; };
|
|
};
|
|
config =
|
|
let
|
|
inherit (inputs.config.nixos.services.nginx.applications) webdav;
|
|
inherit (inputs.lib) mkIf;
|
|
in mkIf webdav.enable
|
|
{
|
|
nixos.services.nginx.https."webdav.chn.moe".location."/".static =
|
|
{
|
|
root = "/srv/webdav";
|
|
index = "auto";
|
|
charset = "utf-8";
|
|
webdav = true;
|
|
detectAuth.users = [ "chn" ];
|
|
};
|
|
systemd =
|
|
{
|
|
tmpfiles.rules = [ "d /srv/webdav 0700 nginx nginx" ];
|
|
services.nginx.serviceConfig.ReadWritePaths = [ "/srv/webdav" ];
|
|
};
|
|
};
|
|
}
|