nix-git/hosts/yodaNas/host-specific.nix

55 lines
1.4 KiB
Nix
Raw Permalink Normal View History

{ config, pkgs, ... }:
{
2023-11-28 15:21:03 +01:00
imports = [
./syncthing.nix
];
2023-11-20 14:09:10 +01:00
2024-10-07 14:02:00 +02:00
# Operating a Snowflake proxy helps others circumvent censorship.
# Safe to run.
# https://wiki.nixos.org/w/index.php?title=Tor
#
# TODO: Check if working.
# systemctl status snowflake-proxy.service
#
# Enable snowflake-proxy, a system to defeat internet censorship.
services.snowflake-proxy.enable = true;
# Maximum concurrent clients allowed.
services.snowflake-proxy.capacity = 10;
# Update and start Jinja-Compose project
# during boot and after every 30 minutes.
# To view the log, run
# journalctl -b -u Jinja-Compose -f
#
systemd.timers."Jinja-Compose" = {
wantedBy = [ "timers.target" ];
partOf = [ "Jinja-Compose.service" ];
timerConfig = {
OnBootSec = "0m";
OnUnitInactiveSec = "30m";
AccuracySec = "1m";
RandomizedDelaySec = "1m";
};
};
2024-01-08 18:40:18 +01:00
# TODO: Add shutdown script (./docker-compose down).
systemd.services."Jinja-Compose" = {
description = "Update and start Jinja-Compose project";
serviceConfig = {
Type = "oneshot";
PrivateTmp = true;
User = "root";
};
path = with pkgs; [
# The `docker-compose` helper script is written in `bash` (!)
bash
docker
];
script = ''
2023-10-08 15:38:44 +02:00
set -eu -o pipefail
/jc-config/docker-compose pull
/jc-config/docker-compose up -d --wait
'';
};
}