Replace custom backup-helper flake input with NixOS native services.restic.backups module for ha1, monitoring01, and nixos-test1. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
78 lines
1.7 KiB
Nix
78 lines
1.7 KiB
Nix
{ config, lib, pkgs, ... }:
|
|
|
|
{
|
|
imports =
|
|
[
|
|
../template/hardware-configuration.nix
|
|
|
|
../../system
|
|
];
|
|
|
|
nixpkgs.config.allowUnfree = true;
|
|
# Use the systemd-boot EFI boot loader.
|
|
boot.loader.grub.enable = true;
|
|
boot.loader.grub.device = "/dev/sda";
|
|
|
|
networking.hostName = "nixos-test1";
|
|
networking.domain = "home.2rjus.net";
|
|
networking.useNetworkd = true;
|
|
networking.useDHCP = false;
|
|
services.resolved.enable = true;
|
|
networking.nameservers = [
|
|
"10.69.13.5"
|
|
"10.69.13.6"
|
|
];
|
|
|
|
systemd.network.enable = true;
|
|
systemd.network.networks."ens18" = {
|
|
matchConfig.Name = "ens18";
|
|
address = [
|
|
"10.69.13.10/24"
|
|
];
|
|
routes = [
|
|
{ Gateway = "10.69.13.1"; }
|
|
];
|
|
linkConfig.RequiredForOnline = "routable";
|
|
};
|
|
time.timeZone = "Europe/Oslo";
|
|
|
|
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
|
nix.settings.tarball-ttl = 0;
|
|
environment.systemPackages = with pkgs; [
|
|
vim
|
|
wget
|
|
git
|
|
];
|
|
|
|
# Open ports in the firewall.
|
|
# networking.firewall.allowedTCPPorts = [ ... ];
|
|
# networking.firewall.allowedUDPPorts = [ ... ];
|
|
# Or disable the firewall altogether.
|
|
networking.firewall.enable = false;
|
|
|
|
# Secrets
|
|
# Backup
|
|
sops.secrets."backup_helper_secret" = { };
|
|
services.restic.backups.test = {
|
|
repository = "rest:http://10.69.12.52:8000/backup-nix";
|
|
passwordFile = "/run/secrets/backup_helper_secret";
|
|
paths = [
|
|
"/etc/machine-id"
|
|
"/etc/os-release"
|
|
];
|
|
timerConfig = {
|
|
OnCalendar = "daily";
|
|
Persistent = true;
|
|
};
|
|
pruneOpts = [
|
|
"--keep-daily 7"
|
|
"--keep-weekly 4"
|
|
"--keep-monthly 6"
|
|
"--keep-within 1d"
|
|
];
|
|
};
|
|
|
|
system.stateVersion = "23.11"; # Did you read the comment?
|
|
}
|
|
|