1
0
mirror of https://github.com/kmein/niveum synced 2026-03-22 12:51:08 +01:00

9 Commits

Author SHA1 Message Date
215bae0b9f fix(ci): add restic password 2022-01-19 13:37:01 +01:00
6f2aab721d chore: revert flake update
it had to build too many things and broke while doing it
2022-01-19 12:36:39 +01:00
1434290100 feat(i3): bye bye astrology 2022-01-19 12:27:14 +01:00
abcbd4dff9 Merge remote-tracking branch 'origin/update_flake_lock_action' 2022-01-19 11:07:08 +01:00
5dbe6b61d1 feat(restic): add wrapper on zaatar 2022-01-19 10:58:44 +01:00
0dc1e167fd feat(restic): backup moodle-dl 2022-01-19 09:41:14 +01:00
6f06f0c9ef feat(restic): add mount script 2022-01-19 09:38:19 +01:00
59894e2734 feat(restic): backup redis 2022-01-19 08:32:44 +01:00
github-actions[bot]
0a8ab261f2 flake.lock: Update
Flake lock file changes:

• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/5d3420c1285073d5061a5d88a533b347d1222750' (2022-01-10)
  → 'github:NixOS/nixpkgs/610d4ea2750e064bf34b33fa38cb671edd893d3d' (2022-01-18)
• Updated input 'nixpkgs-unstable':
    'github:NixOS/nixpkgs/bd20b7f07fd337b2e85420edd642382a2cc0196d' (2022-01-11)
  → 'github:NixOS/nixpkgs/222f62ed88f67a1c9a7854b7e95bd9a5fe67b7ca' (2022-01-18)
• Updated input 'retiolum':
    'github:krebs/retiolum/4fcbe17549fa742a32e05b5f2ca57a983ad500c1' (2022-01-11)
  → 'github:krebs/retiolum/b62eba68b0836a2ea0b786b3738b281f070a3e04' (2022-01-18)
• Updated input 'stockholm':
    'git+https://cgit.lassul.us/stockholm?ref=master&rev=f67bd5783d6ed2be836c7714ea38cbb3f7ac7257' (2022-01-09)
  → 'git+https://cgit.lassul.us/stockholm?ref=master&rev=8d67a33709db13fade3460cc01f385f5bcffd794' (2022-01-15)
2022-01-18 18:26:45 +00:00
6 changed files with 30 additions and 9 deletions

1
ci.nix
View File

@@ -31,6 +31,7 @@ let
"nextcloud-fysi/password"
"nextcloud/password"
"openweathermap.key"
"restic/password"
"traadfri.key"
"wifi/Aether.psk"
"spotify/username"

View File

@@ -25,5 +25,13 @@ in
(pkgs.writers.writeDashBin "restic-niveum" ''
${pkgs.restic}/bin/restic -r ${restic.repository} -p ${<secrets/restic/password>} "$@"
'')
(pkgs.writers.writeDashBin "restic-mount" ''
mountdir=$(mktemp -d)
trap clean EXIT
clean() {
rm "$mountdir"
}
${pkgs.restic}/bin/restic -r ${restic.repository} -p ${<secrets/restic/password>} mount "$mountdir"
'')
];
}

View File

@@ -92,12 +92,6 @@ in {
units = "metric";
};
}
{
block = "custom";
interval = 60 * 5;
command = let inherit (import <niveum/configs/spacetime.nix>) location; in "${pkgs.scripts.horoscope}/bin/horoscope --latitude=${toString location.latitude} --longitude=${toString location.longitude}";
# astrolog -zN Berlin -n -k | tail -n +4 | head -n 7 | sed 's/://g;s/\s\+/ /g;s/ R/R/;s/\[\s*/[/g;s/Sun/☉/;s/Moon/☽/;s/Merc/☿/;s/Venu/♀/;s/Mars/♂/;s/Jupi/♃/;s/Satu/♄/' | cut -f1-2 -d' ' | paste -sd' ' -
}
{
block = "custom";
interval = 60 * 5;

View File

@@ -39,6 +39,7 @@ in
"/var/lib/nextcloud"
"/var/lib/grafana"
"/var/lib/gitea"
"/var/lib/redis"
];
};

View File

@@ -1,19 +1,26 @@
{ lib, ... }:
{ pkgs, lib, ... }:
let
niveumLib = import <niveum/lib>;
inherit (niveumLib) retiolumAddresses restic;
firewall = niveumLib.firewall lib;
dataDir = "/backup/restic";
in
{
services.restic.server = {
enable = true;
appendOnly = true;
dataDir = "/backup/restic";
inherit dataDir;
prometheus = true;
extraFlags = [ "--no-auth" ]; # auth is done via firewall
listenAddress = ":${toString restic.port}";
};
environment.systemPackages = [
(pkgs.writers.writeDashBin "restic-niveum" ''
${pkgs.restic}/bin/restic -r ${toString dataDir} -p ${<secrets/restic/password>} "$@"
'')
];
networking.firewall =
let
dport = restic.port;

View File

@@ -1,6 +1,6 @@
{ config, pkgs, lib, ... }:
let
inherit (import <niveum/lib>) retiolumAddresses;
inherit (import <niveum/lib>) retiolumAddresses restic;
in
{
imports = [
@@ -26,6 +26,16 @@ in
<niveum/modules/retiolum.nix>
];
services.restic.backups.moodle-dl = {
initialize = true;
inherit (restic) repository;
timerConfig = { OnCalendar = "daily"; RandomizedDelaySec = "5h"; };
passwordFile = toString <secrets/restic/password>;
paths = [
"/var/lib/moodle-dl"
];
};
nix.nixPath = [ "/var/src" ];
services.logind = {