fix: certbot nginx premission

This commit is contained in:
DACHXY 2025-04-28 19:13:28 +08:00
parent 56dfb90345
commit e6c4ca5e04
3 changed files with 38 additions and 8 deletions

View file

@ -1,4 +1,9 @@
{ pkgs, ... }: {
pkgs,
settings,
config,
...
}:
{ {
boot.kernelPackages = pkgs.linuxPackages_latest; boot.kernelPackages = pkgs.linuxPackages_latest;
@ -20,15 +25,34 @@
]; ];
}; };
users.groups.windows = {
gid = 1200;
members = [ settings.personal.username ];
};
fileSystems."/mnt/windows" = { fileSystems."/mnt/windows" = {
enable = true;
device = "/dev/disk/by-uuid/460237D00237C429"; device = "/dev/disk/by-uuid/460237D00237C429";
fsType = "ntfs-3g"; fsType = "ntfs-3g";
options = [ options = [
"nofail" "nofail"
"uid=1000" "users"
"gid=1000" "uid=992"
"dmask=077" "gid=${builtins.toString config.users.groups.windows.gid}"
"fmask=077" "dmask=007"
"fmask=007"
];
};
fileSystems."/mnt/nextcloud" = {
enable = true;
depends = [ "/mnt/windows" ];
device = "/mnt/windows/Linux/nextcloud";
fsType = "none";
options = [
"nofail"
"bind"
]; ];
}; };

View file

@ -44,18 +44,23 @@ in
"nextcloud" "nextcloud"
]; ];
}; };
networking.firewall.allowedTCPPorts = [ networking.firewall.allowedTCPPorts = [
80 80
443 443
]; ];
users.groups.windows = {
members = [ "nextcloud" ];
};
services.nextcloud = { services.nextcloud = {
enable = true; enable = true;
datadir = "/mnt/windows/Linux/nextcloud"; datadir = "/mnt/nextcloud";
package = pkgs.nextcloud31; package = pkgs.nextcloud31;
configureRedis = true; configureRedis = true;
hostName = "pre7780.net.dn"; hostName = "pre7780.net.dn";
https = false; https = true;
extraApps = { extraApps = {
inherit (config.services.nextcloud.package.packages.apps) inherit (config.services.nextcloud.package.packages.apps)

View file

@ -23,7 +23,8 @@
"REQUESTS_CA_BUNDLE" = ../extra/ca.crt; "REQUESTS_CA_BUNDLE" = ../extra/ca.crt;
}; };
serviceConfig = { serviceConfig = {
ExecStart = "${pkgs.certbot}/bin/certbot renew"; ExecStart = ''${pkgs.certbot}/bin/certbot renew'';
ExecStartPost = "${pkgs.busybox}/bin/chown nginx:nginx -R /etc/letsencrypt";
}; };
}; };
} }