aboutsummaryrefslogtreecommitdiff
path: root/nixos/configurations/ridcully.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixos/configurations/ridcully.nix')
-rw-r--r--nixos/configurations/ridcully.nix66
1 files changed, 53 insertions, 13 deletions
diff --git a/nixos/configurations/ridcully.nix b/nixos/configurations/ridcully.nix
index 0b2705c..9f3ed57 100644
--- a/nixos/configurations/ridcully.nix
+++ b/nixos/configurations/ridcully.nix
@@ -1,10 +1,4 @@
-{
- lib,
- pkgs,
- ...
-}: let
- inherit (lib) mkDefault;
-in {
+{pkgs, ...}: {
system.stateVersion = "24.05";
nixpkgs.hostPlatform.system = "x86_64-linux";
deploy.enable = true;
@@ -16,14 +10,22 @@ in {
openvpn = {
elektroline = true;
};
+ borgjobs = {
+ hetzner-s3.paths = "/back/hetzner-s3-sync";
+ };
};
- boot.initrd.availableKernelModules = ["nvme" "xhci_pci" "usb_storage"];
+ boot.initrd.availableKernelModules = ["nvme" "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod"];
boot.kernelModules = ["kvm-amd"];
hardware.cpu.amd.updateMicrocode = true;
services.hardware.openrgb.motherboard = "amd";
+ zramSwap = {
+ enable = true;
+ memoryPercent = 50;
+ };
+
cynerd.autounlock = {
"encroot" = "/dev/disk/by-uuid/bc7d2ba4-6e04-4c49-b40c-3aecd1a86c71";
"enchdd" = "/dev/disk/by-uuid/7fee3cda-efa0-47cd-8832-fdead9a7e6db";
@@ -71,13 +73,51 @@ in {
environment.systemPackages = [
pkgs.nvtopPackages.amd
+ #sbctl
];
- services.syncthing = {
- enable = true;
- dataDir = "/home/cynerd";
+ # Force nix to use less jobs
+ nix.settings.max-jobs = 4;
+
+ ##############################################################################
+ services = {
+ syncthing = {
+ enable = true;
+ dataDir = "/home/cynerd";
+ };
+
+ octoprint = {
+ enable = true;
+ openFirewall = true;
+ };
+
+ mjpg-streamer = {
+ enable = true;
+ inputPlugin = "input_uvc.so -d /dev/video2 -r 1920x1080 -f 30";
+ outputPlugin = "output_http.so -p 5001 -w @www@";
+ };
};
+ networking.firewall.allowedTCPPorts = [5001];
- # Force nix to use less jobs
- nix.settings.max-jobs = 8;
+ # Service to synchronize local copy of Hetzner S3
+ systemd = {
+ services."hetzner-sync" = {
+ script = ''
+ /run/current-system/sw/bin/rclone --config /run/secrets/rclone-hetzner.conf \
+ sync hetzner: /back/hetzner-s3-sync
+ '';
+ serviceConfig = {
+ Type = "oneshot";
+ User = "root";
+ };
+ };
+ timers."hetzner-sync" = {
+ wantedBy = ["timers.target"];
+ timerConfig.Unit = "hetzner-sync.service";
+ timerConfig = {
+ OnCalendar = "daily";
+ Persistent = false;
+ };
+ };
+ };
}