From f05869f2bb112e44be980a1fde1d15f4c436b11a Mon Sep 17 00:00:00 2001 From: glenn Date: Tue, 25 Jun 2024 15:22:17 +0200 Subject: [PATCH 1/2] backup vaultwarden --- vaultwarden.nix | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/vaultwarden.nix b/vaultwarden.nix index 104f1f7..99b9ba9 100644 --- a/vaultwarden.nix +++ b/vaultwarden.nix @@ -11,6 +11,24 @@ in }; + services.restic.backups = { + "vaultwarden" = { + passwordFile = "/etc/nixos/.secrets/restic_pw"; + repository = "sftp:Glenn@nas:/home/back/vaultwarden/restic"; + initialize = true; + paths = [ + "/var/lib/bitwarden_rs" + ]; + user = "sondell"; + timerConfig.OnCalendar = "02:05"; + pruneOpts = [ + "--keep-daily 10" + "--keep-weekly 5" + "--keep-monthly 12" + "--keep-yearly 75" + ]; + }; + }; services.nginx.virtualHosts.${domain} = { forceSSL = true; enableACME = true; From 719eda9db99c8520e2fb05155b8d2ddf77029bf8 Mon Sep 17 00:00:00 2001 From: glenn Date: Tue, 2 Jul 2024 08:32:36 +0200 Subject: [PATCH 2/2] derp --- configuration.nix | 1 + home/sondell.nix | 53 +++++++++++++++++++++++++++++++++++++++++------ 2 files changed, 48 insertions(+), 6 deletions(-) diff --git a/configuration.nix b/configuration.nix index 480e604..e127d9b 100644 --- a/configuration.nix +++ b/configuration.nix @@ -130,6 +130,7 @@ environment.systemPackages = with pkgs; [ # vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default. # wget + alejandra restic htop cloudflared diff --git a/home/sondell.nix b/home/sondell.nix index e35b39d..7eb232e 100644 --- a/home/sondell.nix +++ b/home/sondell.nix @@ -9,12 +9,56 @@ # paths it should manage. home.username = "sondell"; home.homeDirectory = "/home/sondell"; - programs.ssh.addKeysToAgent = "yes"; - programs.ssh.enable = true; - programs.ssh.matchBlocks."*".identityFile = [ +programs = { + ssh.addKeysToAgent = "yes"; + ssh.enable = true; + ssh.matchBlocks."*".identityFile = [ "/home/sondell/.ssh/tulpan" ]; + # Let Home Manager install and manage itself. + home-manager.enable = true; + + helix = { + enable = true; + defaultEditor = true; + languages = { + language = [ + { + name = "nix"; + auto-format = true; + formatter = {command = "alejandra";}; + } + { + name = "python"; + auto-format = true; + formatter = { + command = "black"; + args = ["-q" "--fast" "-"]; + }; + } + ]; + }; + settings = { + # theme = "nightfox"; + keys.normal = { + C-up = "expand_selection"; + C-down = "shrink_selection"; + C-left = "select_prev_sibling"; + C-right = "select_next_sibling"; + }; + editor = { + cursor-shape = { + insert = "bar"; + }; + line-number = "relative"; + }; + }; + }; + + +}; + # This value determines the Home Manager release that your # configuration is compatible with. This helps avoid breakage # when a new Home Manager release introduces backwards @@ -24,7 +68,4 @@ # the Home Manager release notes for a list of state version # changes in each release. home.stateVersion = "24.05"; - - # Let Home Manager install and manage itself. - programs.home-manager.enable = true; }