refactor backup

This commit is contained in:
Kopatz
2024-04-21 11:04:18 +02:00
parent ad10b366ec
commit d02e9e0b09
5 changed files with 37 additions and 86 deletions

View File

@@ -477,6 +477,7 @@ local servers = {
rust_analyzer = {},
jdtls = {},
vtsls = {},
clangd = {},
lua_ls = {
Lua = {
@@ -542,15 +543,16 @@ cmp.setup {
fallback()
end
end, { 'i', 's' }),
['<S-Tab>'] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_prev_item()
elseif luasnip.locally_jumpable(-1) then
luasnip.jump(-1)
else
fallback()
end
end, { 'i', 's' }),
--collision
--['<S-Tab>'] = cmp.mapping(function(fallback)
-- if cmp.visible() then
-- cmp.select_prev_item()
-- elseif luasnip.locally_jumpable(-1) then
-- luasnip.jump(-1)
-- else
-- fallback()
-- end
--end, { 'i', 's' }),
},
sources = {
{ name = 'nvim_lsp' },

View File

@@ -0,0 +1,5 @@
vim.g.tabby_keybinding_accept = '<S-Tab>'
return {
'TabbyML/vim-tabby'
}

View File

@@ -11,6 +11,7 @@
checkTime = "(cd /synced/work_drive/TS && nix run)";
checkWaylandWindowsKDE = "qdbus org.kde.KWin /KWin org.kde.KWin.showDebugConsole";
collectGarbage = "sudo nix-collect-garbage --delete-older-than 7d && nix-collect-garbage --delete-older-than 7d";
edit = "nvim ~/projects/github/nix-config";
ll = "ls -l";
ssh = "TERM=xterm-256color ssh";
update = "sudo nixos-rebuild switch";

View File

@@ -4,6 +4,13 @@ let
gitolite = "/var/lib/gitolite";
syncthing = [ "/synced/default/" "/synced/work_drive/" ];
syncthingFull = syncthing ++ [ "/synced/fh/" "/synced/books/" ];
excludePaths = [ "/home/**/Cache" "/home/**/.cache" "/home/**/__pycache__" "/home/**/node_modules" "/home/**/venv" ];
excludePathsRemote = excludePaths ++ "/home/**/dont_remotebackup";
backupPathsSmall = [ "/home" "/var/backup/postgresql" gitolite ] ++ syncthing;
backupPathsMedium = [ "/home" "/var/backup/postgresql" "/mnt/250ssd/matrix-synapse/media_store/" "/mnt/250ssd/paperless" gitolite ] ++ syncthing;
backupPathsFull = [ "/home" "/var/backup/postgresql" "/mnt/250ssd/matrix-synapse/media_store/" "/mnt/250ssd/paperless"
kavita gitolite ] ++ syncthingFull;
in
{
age.secrets.restic-pw = {
@@ -18,68 +25,26 @@ in
services.restic = {
backups = {
localbackup = {
exclude = [
"/home/**/Cache"
"/home/**/.cache"
"/home/**/__pycache__"
"/home/**/node_modules"
"/home/**/venv"
];
initialize = true;
passwordFile = config.age.secrets.restic-pw.path;
paths = [
"/home"
"/var/backup/postgresql"
"/mnt/250ssd/matrix-synapse/media_store/"
"/mnt/250ssd/nextcloud"
"/mnt/250ssd/paperless"
kavita
gitolite
] ++ syncthingFull;
exclude = excludePaths;
paths = backupPathsFull;
pruneOpts = [ "--keep-daily 7" "--keep-weekly 3" "--keep-monthly 3" "--keep-yearly 3" ];
repository = "/mnt/2tb/restic";
};
localbackup-1tb-ssd = {
exclude = [
"/home/**/Cache"
"/home/**/.cache"
"/home/**/__pycache__"
"/home/**/node_modules"
"/home/**/venv"
];
initialize = true;
passwordFile = config.age.secrets.restic-pw.path;
paths = [
"/home"
"/var/backup/postgresql"
"/mnt/250ssd/matrix-synapse/media_store/"
"/mnt/250ssd/nextcloud"
"/mnt/250ssd/paperless"
kavita
gitolite
] ++ syncthingFull;
exclude = excludePaths;
paths = backupPathsFull;
pruneOpts = [ "--keep-daily 7" "--keep-weekly 3" "--keep-monthly 3" "--keep-yearly 3" ];
repository = "/mnt/1tbssd/restic";
};
localbackup-1tb = {
initialize = true;
passwordFile = config.age.secrets.restic-pw.path;
paths = [
"/home"
"/var/backup/postgresql"
"/mnt/250ssd/matrix-synapse/media_store/"
"/mnt/250ssd/nextcloud"
"/mnt/250ssd/paperless"
kavita
gitolite
] ++ syncthingFull;
exclude = [
"/home/**/Cache"
"/home/**/.cache"
"/home/**/__pycache__"
"/home/**/node_modules"
"/home/**/venv"
];
exclude = excludePaths;
paths = backupPathsFull;
repository = "/mnt/1tb/restic";
pruneOpts = [ "--keep-daily 5" "--keep-weekly 3" "--keep-monthly 3" "--keep-yearly 3" ];
timerConfig = {
@@ -90,22 +55,8 @@ in
remotebackup-gdrive = {
initialize = true;
passwordFile = config.age.secrets.restic-pw.path;
paths = [
"/home"
"/var/backup/postgresql"
"/mnt/250ssd/matrix-synapse/media_store/"
"/mnt/250ssd/paperless"
gitolite
] ++ syncthing;
exclude = [
"/home/**/Cache"
"/home/**/.cache"
"/home/**/__pycache__"
"/home/**/node_modules"
"/home/**/dont_remotebackup"
"/home/**/venv"
"**/emu"
];
exclude = excludePathsRemote;
paths = backupPathsMedium;
rcloneConfigFile = config.age.secrets.restic-gdrive.path;
repository = "rclone:it-experts:backup";
pruneOpts = [ "--keep-daily 5" "--keep-weekly 3" "--keep-monthly 3" "--keep-yearly 3" ];
@@ -115,22 +66,11 @@ in
};
};
remotebackup = {
exclude = [
"/home/**/Cache"
"/home/**/.cache"
"/home/**/__pycache__"
"/home/**/node_modules"
"/home/**/venv"
"/home/**/dont_remotebackup"
];
initialize = true;
passwordFile = config.age.secrets.restic-pw.path;
environmentFile = config.age.secrets.restic-s3.path;
paths = [
"/home"
"/var/backup/postgresql"
gitolite
] ++ syncthing;
exclude = excludePathsRemote;
paths = backupPathsSmall;
pruneOpts = [ "--keep-daily 5" "--keep-weekly 3" "--keep-monthly 3" "--keep-yearly 3" ];
timerConfig = {
OnCalendar = "*-*-03,06,09,12,15,18,21,24,27,30 00:00:00";

View File

@@ -9,9 +9,12 @@ in
};
config = mkIf cfg.enable {
documentation.dev.enable = true;
environment.systemPackages = with pkgs; [
man-pages
kate
jetbrains.idea-ultimate
jetbrains.clion
insomnia
nodejs_21 # needed for tabby extension
];