mirror of
https://github.com/harryssecret/homelab-nix.git
synced 2025-08-09 07:00:21 +02:00
Compare commits
28 commits
211e10c0ee
...
72e0ccf471
Author | SHA1 | Date | |
---|---|---|---|
|
72e0ccf471 | ||
|
4a818aa778 | ||
|
3b5a637ec4 | ||
|
c396982ef3 | ||
|
daad8bfe18 | ||
|
7b45af25f1 | ||
|
350a8bb4fd | ||
|
f5fa3790a8 | ||
|
3c2662e5fc | ||
|
43843a39e2 | ||
|
7bd0e4459e | ||
|
bf56f19574 | ||
|
08505b3933 | ||
|
194e9fd7a7 | ||
|
c2de3f7cff | ||
|
7f485371d4 | ||
|
b7cedb7933 | ||
|
5c4ff80858 | ||
|
d22840eb0a | ||
|
710d7f5aea | ||
|
4ec9428370 | ||
|
ebdd3dccf5 | ||
|
d9db3909c0 | ||
|
16d00b902b | ||
|
1b61750dcf | ||
|
41e9161fce | ||
|
ae1eab6ff3 | ||
|
be289c7cef |
2 changed files with 51 additions and 36 deletions
|
@ -5,15 +5,24 @@
|
|||
ignoreIP = [ "192.168.1.0/24" ];
|
||||
extraPackages = [ ];
|
||||
jails = {
|
||||
/*
|
||||
nextcloud = ''
|
||||
enabled = true;
|
||||
filter = nextcloud
|
||||
port = http,https
|
||||
'';
|
||||
*/
|
||||
};
|
||||
sshd = ''
|
||||
enabled = true
|
||||
port = ssh
|
||||
logpath = %(sshd_log)s
|
||||
backend = %(sshd_backend)s
|
||||
'';
|
||||
};
|
||||
|
||||
environment.etc = {
|
||||
/*
|
||||
"fail2ban/filter.d/nextcloud.conf".text = ''
|
||||
[Definition]
|
||||
_groupsre = (?:(?:,?\s*"\w+":(?:"[^"]+"|\w+))*)
|
||||
|
@ -23,6 +32,7 @@
|
|||
^[^{]*\{%(_groupsre)s,?\s*"remoteAddr":"<HOST>"%(_groupsre)s,?\s*"message":"Two-factor challenge failed:
|
||||
journalmatch = _SYSTEMD_UNIT=phpfpm-nextcloud.service
|
||||
'';
|
||||
*/
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -26,24 +26,8 @@ let
|
|||
"${theme}": "/static/themes/${theme}.json"
|
||||
}
|
||||
'';
|
||||
akkoma-overlay = self: super: {
|
||||
akkoma = super.akkoma.overrideAttrs (old: {
|
||||
postPatch = ''
|
||||
mkdir -p $out/priv/static/themes
|
||||
|
||||
cp ${themeSrc} $out/priv/static/themes/${theme}.json
|
||||
cp ${pkgs.writeText "styles.json" styles} $out/priv/static/themes
|
||||
cp ${tosFile} $out/priv/static/terms-of-service.html
|
||||
'';
|
||||
|
||||
buildInputs = old.buildInputs ++ [
|
||||
pkgs.curl
|
||||
];
|
||||
});
|
||||
};
|
||||
in
|
||||
{
|
||||
nixpkgs.overlays = [ akkoma-overlay ];
|
||||
services.akkoma.enable = true;
|
||||
services.akkoma.initDb.enable = true;
|
||||
services.akkoma.config = {
|
||||
|
@ -67,21 +51,42 @@ in
|
|||
base_url = "https://blurb.rougebordeaux.xyz/media";
|
||||
link_name = true;
|
||||
filters = map (pkgs.formats.elixirConf { }).lib.mkRaw [
|
||||
"Pleroma.Upload.Filter.Exiftool"
|
||||
"Pleroma.Upload.Filter.Exiftool.StripMetadata"
|
||||
"Pleroma.Upload.Filter.Dedupe"
|
||||
"Pleroma.Upload.Filter.AnonymizeFilename"
|
||||
];
|
||||
};
|
||||
":configurable_from_database" = false;
|
||||
"frontend_configurations" = {
|
||||
"pleroma_fe" = {
|
||||
":frontend_configurations" = {
|
||||
"primary" = {
|
||||
"theme" = "${theme}";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
services.akkoma.frontends.primary = {
|
||||
name = "akkoma-fe";
|
||||
ref = "stable";
|
||||
package =
|
||||
pkgs.runCommand "akkoma-fe"
|
||||
{
|
||||
nativeBuildInputs = with pkgs; [
|
||||
xorg.lndir
|
||||
];
|
||||
}
|
||||
''
|
||||
mkdir $out
|
||||
lndir ${pkgs.akkoma-fe} $out
|
||||
|
||||
services.caddy.virtualHosts."${pleromaUrl}".extraConfig = ''
|
||||
cp ${themeSrc} $out/static/themes/${theme}.json
|
||||
rm $out/static/styles.json
|
||||
cp ${pkgs.writeText "styles.json" styles} $out/static/styles.json
|
||||
rm $out/static/terms-of-service.html
|
||||
cp ${tosFile} $out/static/terms-of-service.html
|
||||
'';
|
||||
};
|
||||
|
||||
services.caddy.virtualHosts."http://${pleromaUrl}".extraConfig = ''
|
||||
log {
|
||||
output file /var/log/caddy/akkoma.log
|
||||
}
|
||||
|
@ -90,7 +95,7 @@ in
|
|||
reverse_proxy 127.0.0.1:4000
|
||||
'';
|
||||
|
||||
services.caddy.virtualHosts."${pleromaMediaUrl}".extraConfig = ''
|
||||
services.caddy.virtualHosts."http://${pleromaMediaUrl}".extraConfig = ''
|
||||
log {
|
||||
output file /var/log/caddy/akkoma_media.log
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue