mirror of
https://github.com/phfroidmont/self-hosting.git
synced 2025-12-25 05:36:59 +01:00
Start migrating config to NixOS modules
This commit is contained in:
parent
c1211cb4e5
commit
c0d929be0b
11 changed files with 283 additions and 183 deletions
|
|
@ -3,13 +3,10 @@
|
|||
imports = [
|
||||
../environment.nix
|
||||
../hardware/hcloud.nix
|
||||
../modules/openssh.nix
|
||||
../modules
|
||||
../modules/nginx.nix
|
||||
../modules/murmur.nix
|
||||
../modules/synapse.nix
|
||||
../modules/nextcloud.nix
|
||||
../modules/custom-backup-job.nix
|
||||
../modules/custom-monit.nix
|
||||
../modules/dokuwiki.nix
|
||||
../modules/website-marie.nix
|
||||
../modules/roundcube.nix
|
||||
|
|
@ -23,36 +20,50 @@
|
|||
};
|
||||
};
|
||||
|
||||
services.custom-backup-job = {
|
||||
additionalPaths = [ "/var/lib/nextcloud/config" ];
|
||||
readWritePaths = [ "/nix/var/data/murmur" "/nix/var/data/backup/" ];
|
||||
preHook = ''
|
||||
cp /var/lib/murmur/murmur.sqlite /nix/var/data/murmur/murmur.sqlite
|
||||
'';
|
||||
postHook = ''
|
||||
touch /nix/var/data/backup/backup-ok
|
||||
'';
|
||||
startAt = "03:30";
|
||||
sshKey = config.sops.secrets.borgSshKey.path;
|
||||
custom = {
|
||||
services.backup-job = {
|
||||
enable = true;
|
||||
additionalPaths = [ "/var/lib/nextcloud/config" ];
|
||||
readWritePaths = [ "/nix/var/data/murmur" "/nix/var/data/backup/" ];
|
||||
preHook = ''
|
||||
cp /var/lib/murmur/murmur.sqlite /nix/var/data/murmur/murmur.sqlite
|
||||
'';
|
||||
postHook = ''
|
||||
touch /nix/var/data/backup/backup-ok
|
||||
'';
|
||||
startAt = "03:30";
|
||||
sshKey = config.sops.secrets.borgSshKey.path;
|
||||
};
|
||||
|
||||
services.monit = {
|
||||
enable = true;
|
||||
additionalConfig = ''
|
||||
check file nextcloud-data-mounted with path /var/lib/nextcloud/data/index.html
|
||||
start = "${pkgs.systemd}/bin/systemctl start nextcloud-data-sshfs.service"
|
||||
|
||||
check host jellyfin with address jellyfin.banditlair.com
|
||||
if failed port 443 protocol https with timeout 20 seconds then alert
|
||||
check host stb with address www.societe-de-tir-bertrix.com
|
||||
if failed port 443 protocol https with timeout 20 seconds then alert
|
||||
|
||||
check host transmission with address transmission.banditlair.com
|
||||
if failed
|
||||
port 443
|
||||
protocol https
|
||||
status = 401
|
||||
with timeout 20 seconds
|
||||
then alert
|
||||
'';
|
||||
};
|
||||
|
||||
services.dokuwiki.enable = true;
|
||||
|
||||
services.openssh.enable = true;
|
||||
|
||||
services.murmur.enable = true;
|
||||
};
|
||||
|
||||
services.custom-monit.additionalConfig = ''
|
||||
check file nextcloud-data-mounted with path /var/lib/nextcloud/data/index.html
|
||||
start = "${pkgs.systemd}/bin/systemctl start nextcloud-data-sshfs.service"
|
||||
|
||||
check host jellyfin with address jellyfin.banditlair.com
|
||||
if failed port 443 protocol https with timeout 20 seconds then alert
|
||||
check host stb with address www.societe-de-tir-bertrix.com
|
||||
if failed port 443 protocol https with timeout 20 seconds then alert
|
||||
|
||||
check host transmission with address transmission.banditlair.com
|
||||
if failed
|
||||
port 443
|
||||
protocol https
|
||||
status = 401
|
||||
with timeout 20 seconds
|
||||
then alert
|
||||
'';
|
||||
|
||||
networking.interfaces.enp1s0 = {
|
||||
useDHCP = true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue