I fucking hate NixOS wiki sometimes.
This commit is contained in:
parent
e2a8420dce
commit
4c393a7f92
1 changed files with 21 additions and 0 deletions
|
|
@ -152,6 +152,27 @@ in {
|
|||
}"
|
||||
];
|
||||
|
||||
# Fallback: one-shot systemd service to copy custom assets on activation (works even if tmpfiles isn't applied or for live testing)
|
||||
systemd.services."forgejo-custom-files" = {
|
||||
description = "Install Forgejo custom templates and assets into customDir";
|
||||
after = [ "network.target" ];
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
# Use bash -c to run a compact copy/install script that ensures dirs exist and files are owned by forgejo
|
||||
ExecStart = ''${pkgs.bash}/bin/bash -c "set -eu; \
|
||||
install -d -m0755 -o forgejo -g forgejo ${config.services.forgejo.customDir}/public/assets/fonts; \
|
||||
install -d -m0755 -o forgejo -g forgejo ${config.services.forgejo.customDir}/public/assets/css; \
|
||||
install -d -m0755 -o forgejo -g forgejo ${config.services.forgejo.customDir}/templates/custom; \
|
||||
cp -a ${mapleFonts}/fonts/MapleMonoNerd.ttf ${config.services.forgejo.customDir}/public/assets/fonts/MapleMonoNerd.ttf; \
|
||||
cp -a ${toString ../styling/forgejo/header.tmpl} ${config.services.forgejo.customDir}/templates/custom/header.tmpl; \
|
||||
cp -a ${toString ../styling/forgejo/home.tmpl} ${config.services.forgejo.customDir}/templates/home.tmpl; \
|
||||
cp -a ${toString ../styling/forgejo/theme-custom.css} ${config.services.forgejo.customDir}/public/assets/css/theme-custom.css; \
|
||||
chown -R forgejo:forgejo ${config.services.forgejo.customDir}"'';
|
||||
};
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
};
|
||||
|
||||
# Open ports in the firewall.
|
||||
networking.firewall.allowedTCPPorts = [3000];
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue