mirror of
https://github.com/kmein/niveum
synced 2026-03-22 12:51:08 +01:00
Compare commits
9 Commits
f3835ebd5e
...
215bae0b9f
| Author | SHA1 | Date | |
|---|---|---|---|
| 215bae0b9f | |||
| 6f2aab721d | |||
| 1434290100 | |||
| abcbd4dff9 | |||
| 5dbe6b61d1 | |||
| 0dc1e167fd | |||
| 6f06f0c9ef | |||
| 59894e2734 | |||
|
|
0a8ab261f2 |
1
ci.nix
1
ci.nix
@@ -31,6 +31,7 @@ let
|
||||
"nextcloud-fysi/password"
|
||||
"nextcloud/password"
|
||||
"openweathermap.key"
|
||||
"restic/password"
|
||||
"traadfri.key"
|
||||
"wifi/Aether.psk"
|
||||
"spotify/username"
|
||||
|
||||
@@ -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"
|
||||
'')
|
||||
];
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -39,6 +39,7 @@ in
|
||||
"/var/lib/nextcloud"
|
||||
"/var/lib/grafana"
|
||||
"/var/lib/gitea"
|
||||
"/var/lib/redis"
|
||||
];
|
||||
};
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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 = {
|
||||
|
||||
Reference in New Issue
Block a user