mirror of
https://github.com/Ahwxorg/nixos-config.git
synced 2025-12-04 15:00:13 +01:00
Compare commits
6 commits
84f7e2ce6a
...
1b514a44c2
| Author | SHA1 | Date | |
|---|---|---|---|
| 1b514a44c2 | |||
| 80094a6827 | |||
| 71a6033d2a | |||
| b953c86a2f | |||
| 4da11942eb | |||
| 54447480e5 |
5 changed files with 67 additions and 6 deletions
|
|
@ -12,6 +12,10 @@
|
||||||
./../../modules/services/dandelion.nix
|
./../../modules/services/dandelion.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
|
users.users.liv.openssh.authorizedKeys.keys = [
|
||||||
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOLdcB5JFWx6OK2BAr8J0wPHNhr2VP2/Ci6fv3a+DPfo liv@violet" # allow violet to log in over ssh to do back ups
|
||||||
|
];
|
||||||
|
|
||||||
networking.hostName = "dandelion";
|
networking.hostName = "dandelion";
|
||||||
|
|
||||||
liv.server.enable = true;
|
liv.server.enable = true;
|
||||||
|
|
|
||||||
54
hosts/violet/backups.nix
Normal file
54
hosts/violet/backups.nix
Normal file
|
|
@ -0,0 +1,54 @@
|
||||||
|
let
|
||||||
|
borgbackupMonitor =
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
with lib;
|
||||||
|
{
|
||||||
|
key = "borgbackupMonitor";
|
||||||
|
_file = "borgbackupMonitor";
|
||||||
|
config.systemd.services =
|
||||||
|
{
|
||||||
|
"notify-problems@" = {
|
||||||
|
enable = true;
|
||||||
|
serviceConfig.User = "liv";
|
||||||
|
environment.SERVICE = "%i";
|
||||||
|
script = ''
|
||||||
|
${pkgs.curl}/bin/curl -d "$SERVICE FAILED! - service $SERVICE on host $(hostname) failed, run journalctl -u $SERVICE for details."
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
}
|
||||||
|
// flip mapAttrs' config.services.borgbackup.jobs (
|
||||||
|
name: value:
|
||||||
|
nameValuePair "borgbackup-job-${name}" {
|
||||||
|
unitConfig.OnFailure = "notify-problems@%i.service";
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
# optional, but this actually forces backup after boot in case laptop was powered off during scheduled event
|
||||||
|
# for example, if you scheduled backups daily, your laptop should be powered on at 00:00
|
||||||
|
config.systemd.timers = flip mapAttrs' config.services.borgbackup.jobs (
|
||||||
|
name: value:
|
||||||
|
nameValuePair "borgbackup-job-${name}" {
|
||||||
|
timerConfig.Persistent = true;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
in
|
||||||
|
{
|
||||||
|
imports = [ borgbackupMonitor ];
|
||||||
|
services = {
|
||||||
|
borgbackup.jobs.liv-violet = {
|
||||||
|
paths = "/home/liv";
|
||||||
|
encryption.mode = "none";
|
||||||
|
environment.BORG_RSH = "ssh -i /home/liv/.ssh/id_ed25519";
|
||||||
|
repo = "ssh://liv@100.115.178.50:9123/spinners/rootvol/backups/hosts/violet";
|
||||||
|
compression = "auto,zstd";
|
||||||
|
startAt = "daily";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -9,6 +9,7 @@
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
./../../modules/core/default.server.nix
|
./../../modules/core/default.server.nix
|
||||||
./../../modules/services/violet.nix
|
./../../modules/services/violet.nix
|
||||||
|
# ./backups.nix # disable for now, test first.
|
||||||
];
|
];
|
||||||
|
|
||||||
networking.hostName = "violet";
|
networking.hostName = "violet";
|
||||||
|
|
@ -24,15 +25,16 @@
|
||||||
pkgs.kitty.terminfo
|
pkgs.kitty.terminfo
|
||||||
];
|
];
|
||||||
|
|
||||||
services.smartd = {
|
services = {
|
||||||
enable = lib.mkForce false;
|
smartd = {
|
||||||
autodetect = lib.mkForce false;
|
enable = lib.mkForce false;
|
||||||
|
autodetect = lib.mkForce false;
|
||||||
|
};
|
||||||
|
xserver.videoDrivers = [ "nvidia" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
liv.nvidia.enable = true;
|
liv.nvidia.enable = true;
|
||||||
|
|
||||||
services.xserver.videoDrivers = [ "nvidia" ];
|
|
||||||
|
|
||||||
boot = {
|
boot = {
|
||||||
loader.grub = {
|
loader.grub = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ in
|
||||||
listen-http = "127.0.0.1:${toString port}";
|
listen-http = "127.0.0.1:${toString port}";
|
||||||
behind-proxy = true;
|
behind-proxy = true;
|
||||||
visitor-attachment-daily-bandwidth-limit = "10M";
|
visitor-attachment-daily-bandwidth-limit = "10M";
|
||||||
visitor-request-limit-burst = 5;
|
visitor-request-limit-burst = 15;
|
||||||
visitor-request-limit-replenish = "15s";
|
visitor-request-limit-replenish = "15s";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,7 @@
|
||||||
++ [ (import ./nginx.nix) ]
|
++ [ (import ./nginx.nix) ]
|
||||||
# ++ [(import ./komga.nix)]
|
# ++ [(import ./komga.nix)]
|
||||||
++ [ (import ./radicale.nix) ]
|
++ [ (import ./radicale.nix) ]
|
||||||
|
++ [ (import ./tailscale.nix) ]
|
||||||
++ [ (import ./readarr.nix) ];
|
++ [ (import ./readarr.nix) ];
|
||||||
# ++ [(import ./smart-monitoring.nix)]
|
# ++ [(import ./smart-monitoring.nix)]
|
||||||
# ++ [(import ./jitsi-meet.nix)]
|
# ++ [(import ./jitsi-meet.nix)]
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue