diff --git a/SwarselSystems.org b/SwarselSystems.org index 8d23c06..949daef 100644 --- a/SwarselSystems.org +++ b/SwarselSystems.org @@ -2990,6 +2990,7 @@ This program sets up a new NixOS host remotely. It also takes care of secret man rm modules/home/common/git.nix rm modules/home/common/mail.nix rm modules/home/common/yubikey.nix + rm modules/nixos/server/restic.nix rm modules/nixos/common/home-manager-extra.nix nix flake update vbc-nix git add . @@ -3125,6 +3126,7 @@ if [[ $local_keys != *"${pub_arr[1]}"* ]]; then rm modules/home/common/git.nix rm modules/home/common/mail.nix rm modules/home/common/yubikey.nix + rm modules/nixos/server/restic.nix rm modules/nixos/common/home-manager-extra.nix rm -rf modules/nixos/server rm -rf modules/home/server @@ -4029,6 +4031,7 @@ Modules that need to be loaded on the NixOS level. Note that these will not be a nginx = lib.mkDefault true; ssh = lib.mkDefault true; kavita = lib.mkDefault true; + restic = lib.mkDefault true; jellyfin = lib.mkDefault true; navidrome = lib.mkDefault true; spotifyd = lib.mkDefault true; @@ -7736,12 +7739,50 @@ Here we just define some aliases for rebuilding the system, and we allow some in Once this is finished, it will house a restic client that manages automatic backups of my image library. Before I get to this however, I first need to organice my pictures in the first place. #+begin_src nix :tangle modules/nixos/server/restic.nix - { lib, config, ... }: + { lib, config, inputs, ... }: + let + secretsDirectory = builtins.toString inputs.nix-secrets; + resticRepo = lib.swarselsystems.getSecret "${secretsDirectory}/restic/wintersRepo"; + in { options.swarselsystems.modules.server.restic = lib.mkEnableOption "enable restic backups on server"; config = lib.mkIf config.swarselsystems.modules.server.restic { - # TODO + sops = { + secrets = { + resticpw = { }; + resticaccesskey = { }; + resticsecretaccesskey = { }; + }; + templates = { + "restic-env".content = '' + AWS_ACCESS_KEY_ID=${config.sops.placeholder.resticaccesskey} + AWS_SECRET_ACCESS_KEY=${config.sops.placeholder.resicsecretaccesskey} + ''; + }; + }; + + services.restic = { + backups = { + SwarselWinters = { + environmentFile = config.sops.templates."restic-env".path; + passwordFile = config.sops.secrets.resticpw.path; + paths = [ + "/Vault/data/paperless" + "/Vault/Eternor/Paperless" + "/Vault/data/paperless" + "/Vault/Eternor/Bilder" + "/Vault/Eternor/Immich" + ]; + repository = "${resticRepo}"; + initialize = true; + timerConfig = { + OnCalendar = "19:00"; + }; + }; + + }; + }; }; } diff --git a/index.html b/index.html index 96c53b7..2f2272c 100644 --- a/index.html +++ b/index.html @@ -3,7 +3,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
- +-This file has 62553 words spanning 16386 lines and was last revised on 2025-05-24 17:27:46 +0200. +This file has 62656 words spanning 16427 lines and was last revised on 2025-05-24 18:24:21 +0200.
@@ -763,7 +763,7 @@ This section defines my Emacs configuration. For a while, I considered to use ry
-My emacs is built using the emacs-overlay nix flake, which builds a bleeding edge emacs on wayland (pgtk) with utilities like treesitter support. By executing the below source block, the current build setting can be updated at any time, and you can see my most up-to-date build options (last updated: 2025-05-24 17:27:46 +0200) +My emacs is built using the emacs-overlay nix flake, which builds a bleeding edge emacs on wayland (pgtk) with utilities like treesitter support. By executing the below source block, the current build setting can be updated at any time, and you can see my most up-to-date build options (last updated: 2025-05-24 18:24:21 +0200)
@@ -2800,8 +2800,8 @@ This is just a demo host. It applies all the configuration found in the common p I also set theWLR_RENDERER_ALLOW_SOFTWARE=1 to allow this configuration to run in a virtualized environment. I also enable qemuGuest for a smoother experience when testing on QEMU.
-{ self, inputs, config, pkgs, lib, primaryUser, ... }:
@@ -2880,8 +2880,8 @@ in
_: @@ -2891,8 +2891,8 @@ in
_:
@@ -4049,6 +4049,7 @@ if [[ $local_keys != *"${pub_arr[1]}"* ]]; then
rm modules/home/common/git.nix
rm modules/home/common/mail.nix
rm modules/home/common/yubikey.nix
+ rm modules/nixos/server/restic.nix
rm modules/nixos/common/home-manager-extra.nix
nix flake update vbc-nix
git add .
@@ -4187,6 +4188,7 @@ if [[ $local_keys != *"${pub_arr[1]}"* ]]; then
rm modules/home/common/git.nix
rm modules/home/common/mail.nix
rm modules/home/common/yubikey.nix
+ rm modules/nixos/server/restic.nix
rm modules/nixos/common/home-manager-extra.nix
rm -rf modules/nixos/server
rm -rf modules/home/server
@@ -4667,8 +4669,8 @@ appimageTools.wrapType2 {
This programs simply runs ssh-keygen on the last host that I tried to ssh into. I need this frequently when working with cloud-init usually. @@ -4817,8 +4819,8 @@ in
{ lib, config, ... }:
@@ -4885,8 +4887,8 @@ in
{ lib, config, ... }:
@@ -4950,8 +4952,8 @@ in
{ lib, config, ... }:
@@ -4983,8 +4985,8 @@ in
{ lib, config, ... }:
@@ -5005,8 +5007,8 @@ in
{ lib, config, ... }:
@@ -5027,8 +5029,8 @@ in
{ lib, config, ... }:
@@ -5049,8 +5051,8 @@ in
{ lib, config, ... }:
@@ -5071,8 +5073,8 @@ in
{ lib, config, ... }:
@@ -5093,8 +5095,8 @@ in
{ lib, config, ... }:
@@ -5115,8 +5117,8 @@ in
{ lib, config, ... }:
@@ -5142,6 +5144,7 @@ in
nginx = lib.mkDefault true;
ssh = lib.mkDefault true;
kavita = lib.mkDefault true;
+ restic = lib.mkDefault true;
jellyfin = lib.mkDefault true;
navidrome = lib.mkDefault true;
spotifyd = lib.mkDefault true;
@@ -5166,8 +5169,8 @@ in
{ lib, config, ... }:
@@ -5224,8 +5227,8 @@ in
{ lib, config, ... }:
@@ -5282,8 +5285,8 @@ in
{ lib, config, ... }:
@@ -5335,8 +5338,8 @@ in
{ lib, config, ... }:
@@ -5356,8 +5359,8 @@ in
{ lib, config, ... }:
@@ -5377,8 +5380,8 @@ in
{ lib, config, ... }:
@@ -5399,8 +5402,8 @@ in
{ lib, config, ... }:
@@ -5418,8 +5421,8 @@ in
{ lib, config, ... }:
@@ -6952,8 +6955,8 @@ Most of the time I am using power-saver, however, it is good to be
{ lib, pkgs, config, ... }:
@@ -9027,12 +9030,50 @@ Once this is finished, it will house a restic client that manages automatic back
-{ lib, config, ... }:
+{ lib, config, inputs, ... }:
+let
+ secretsDirectory = builtins.toString inputs.nix-secrets;
+ resticRepo = lib.swarselsystems.getSecret "${secretsDirectory}/restic/wintersRepo";
+in
{
options.swarselsystems.modules.server.restic = lib.mkEnableOption "enable restic backups on server";
config = lib.mkIf config.swarselsystems.modules.server.restic {
- # TODO
+ sops = {
+ secrets = {
+ resticpw = { };
+ resticaccesskey = { };
+ resticsecretaccesskey = { };
+ };
+ templates = {
+ "restic-env".content = ''
+ AWS_ACCESS_KEY_ID=${config.sops.placeholder.resticaccesskey}
+ AWS_SECRET_ACCESS_KEY=${config.sops.placeholder.resicsecretaccesskey}
+ '';
+ };
+ };
+
+ services.restic = {
+ backups = {
+ SwarselWinters = {
+ environmentFile = config.sops.templates."restic-env".path;
+ passwordFile = config.sops.secrets.resticpw.path;
+ paths = [
+ "/Vault/data/paperless"
+ "/Vault/Eternor/Paperless"
+ "/Vault/data/paperless"
+ "/Vault/Eternor/Bilder"
+ "/Vault/Eternor/Immich"
+ ];
+ repository = "${resticRepo}";
+ initialize = true;
+ timerConfig = {
+ OnCalendar = "19:00";
+ };
+ };
+
+ };
+ };
};
}
@@ -9665,8 +9706,8 @@ This smashes Atmosphere 1.3.2 on the switch, which is what I am currenty using.
This holds configuration that is specific to framework laptops. @@ -9704,8 +9745,8 @@ This holds configuration that is specific to framework laptops.
{ lib, config, ... }:
@@ -9721,8 +9762,8 @@ This holds configuration that is specific to framework laptops.
{ lib, config, ... }:
@@ -9744,8 +9785,8 @@ This holds configuration that is specific to framework laptops.
{ lib, config, ... }:
@@ -9776,8 +9817,8 @@ This holds configuration that is specific to framework laptops.
{ lib, config, ... }:
@@ -12693,8 +12734,8 @@ The `extraConfig` section here CANNOT be reindented. This has something to do wi
{ lib, config, ... }:
@@ -13943,8 +13984,8 @@ in
This holds configuration that is specific to framework laptops. @@ -17784,8 +17825,8 @@ autocmd DocStart vc-impimba-1.m.imp.ac.at/ui/webconsole mode ignore
@@ -18282,7 +18323,7 @@ sync USER HOST: