Compare commits

..

No commits in common. "2ce900c1c83cd5baa91cb5b40f605f88fffa3c27" and "6bb66f3e21627cc3ca9487a112393260e2749882" have entirely different histories.

3 changed files with 6 additions and 46 deletions

View file

@ -1,39 +0,0 @@
{ config, pkgs, ... }:
let
user = "misskey-backup";
group = user;
# shell script file to be sourced. must have values "bucket" "prefix" and "s3cfg"
backupConfigFile = "/etc/misskey-backup";
backupScript = pkgs.writeShellApplication {
name = "misskey-backup";
runtimeInputs = with pkgs; [
gzip
config.services.postgresql.package
s3cmd
coreutils
];
text = ''
source "${backupConfigFile}"
pg_dump misskey | gzip | s3cmd put --config "$s3cfg" - "s3://$bucket/$prefix/misskey-pgdump-$(date --iso-8601).sql.gz"
'';
};
in {
users.users."${user}" = {
isSystemUser = true;
inherit group;
};
users.groups."${group}" = { };
services.postgresql.ensureUsers = [{ name = user; }];
services.cron = {
enable = true;
systemCronJobs = [
# run every monday at ass in the morning, EST"
"0 8 0 0 1 ${user} ${backupScript}"
];
};
}

View file

@ -6,7 +6,6 @@
./ogdo.nix
./postfix.nix
./nebula.nix
./backup.nix
];
nix.settings = {

12
flake.lock generated
View file

@ -2,11 +2,11 @@
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1734529975,
"narHash": "sha256-ze3IJksru9dN0keqUxY0WNf8xrwfs8Ty/z9v/keyBbg=",
"lastModified": 1728328465,
"narHash": "sha256-a0a0M1TmXMK34y3M0cugsmpJ4FJPT/xsblhpiiX1CXo=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "72d11d40b9878a67c38f003c240c2d2e1811e72a",
"rev": "1bfbbbe5bbf888d675397c66bfdb275d0b99361c",
"type": "github"
},
"original": {
@ -24,11 +24,11 @@
},
"unstable": {
"locked": {
"lastModified": 1734424634,
"narHash": "sha256-cHar1vqHOOyC7f1+tVycPoWTfKIaqkoe1Q6TnKzuti4=",
"lastModified": 1728241625,
"narHash": "sha256-yumd4fBc/hi8a9QgA9IT8vlQuLZ2oqhkJXHPKxH/tRw=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "d3c42f187194c26d9f0309a8ecc469d6c878ce33",
"rev": "c31898adf5a8ed202ce5bea9f347b1c6871f32d1",
"type": "github"
},
"original": {