diff options
author | Anthony Wang | 2025-04-03 23:06:46 -0400 |
---|---|---|
committer | Anthony Wang | 2025-04-03 23:06:46 -0400 |
commit | 26f49fb43a2277b4b3b465f692238a083d530ebd (patch) | |
tree | dfe81b7e69f22cb295b7fdb5a58443721a654909 | |
parent | a15ed39a4490ee7a0a8c0a2312eb7f47dcabcdbf (diff) |
Add btrbk and killfprint configs
-rw-r--r-- | configuration.nix | 62 |
1 files changed, 54 insertions, 8 deletions
diff --git a/configuration.nix b/configuration.nix index e33c0aa..d1268c0 100644 --- a/configuration.nix +++ b/configuration.nix @@ -15,7 +15,7 @@ enable = true; extraPackages = with pkgs; [ intel-media-driver - intel-compute-runtime + intel-compute-runtime # TODO this doesn't work?? ]; }; @@ -75,13 +75,14 @@ # Apps maliit-keyboard kile - kdePackages.neochat # Nix complains this is insecure + kdePackages.neochat kdePackages.tokodon rnote mpv mpvScripts.mpris # Other + syncthing hugo rclone gocryptfs @@ -93,7 +94,6 @@ wqy_microhei ]; - # TODO: This doesn't work i18n.inputMethod = { enable = true; type = "fcitx5"; @@ -106,22 +106,68 @@ services.desktopManager.plasma6.enable = true; services.fprintd.enable = true; services.fwupd.enable = true; - # TODO: configure syncthing - # services.syncthing.enable = true; - # services.syncthing.user = "a"; + + services.btrbk.instances."btrbk" = { + onCalendar = "daily UTC"; + settings = { + backend = "btrfs-progs"; + transaction_log = "/var/log/btrbk.log"; + timestamp_format = "short"; + volume = { + "/" = { + subvolume = "/home"; + snapshot_dir = "/.snapshots"; + snapshot_preserve = "3d 3w 3m *y"; + snapshot_preserve_min = "latest"; + }; + "ssh://unnamed.website/" = { + subvolume = "."; + snapshot_dir = "/.snapshots"; + snapshot_preserve_min = "all"; + snapshot_create = "no"; + target = "/.snapshots"; + target_preserve = "3d 3w 3m *y"; + target_preserve_min = "latest"; + send_compressed_data = "yes"; + }; + }; + }; + }; + + systemd.services.btrbk-btrbk = { + # The remote server uses UTC so we have to too + environment = { + TZ = "utc"; + }; + serviceConfig = { + # Wait a bit so the remote server can create the snapshot + # And wait for internet connectivity if we just woke up + ExecStartPre = "sleep 10"; + }; + }; + + systemd.services.killfprintd = { + wantedBy = [ "sleep.target" ]; + before = [ "sleep.target" ]; + serviceConfig = { + ExecStart = "killall fprintd"; + }; + }; # Don't enable fprintd for everything # Otherwise SDDM takes 30 seconds to log in security.pam.services.login.fprintAuth = false; security.pam.services.sudo.fprintAuth = true; - # TODO: btrbk - # TODO: delete this eventually nixpkgs.config.permittedInsecurePackages = [ "olm-3.2.16" ]; + # TODO + # switchvirtualkeyboard script + # vscode dafny extension + # This option defines the first version of NixOS you have installed on this particular machine, # and is used to maintain compatibility with application data (e.g. databases) created on older NixOS versions. # |