From e1c6f1e99c924309943625eab8b6682867086d40 Mon Sep 17 00:00:00 2001 From: notohh Date: Sun, 11 Jun 2023 00:04:15 -0400 Subject: [PATCH] ame: init restic, nas, etc --- hosts/ame/default.nix | 7 ++--- hosts/ame/hardware-configuration.nix | 5 ++++ hosts/ame/home.nix | 2 +- hosts/ame/services/default.nix | 5 ++++ hosts/ame/services/restic.nix | 40 ++++++++++++++++++++++++++++ 5 files changed, 53 insertions(+), 6 deletions(-) create mode 100644 hosts/ame/services/default.nix create mode 100644 hosts/ame/services/restic.nix diff --git a/hosts/ame/default.nix b/hosts/ame/default.nix index e014174..6d80112 100644 --- a/hosts/ame/default.nix +++ b/hosts/ame/default.nix @@ -1,10 +1,7 @@ -{ - config, - pkgs, - ... -}: { +{...}: { imports = [ ./hardware-configuration.nix + ./services ../../modules ../../modules/fonts.nix ]; diff --git a/hosts/ame/hardware-configuration.nix b/hosts/ame/hardware-configuration.nix index 83aa026..aec1f4d 100644 --- a/hosts/ame/hardware-configuration.nix +++ b/hosts/ame/hardware-configuration.nix @@ -19,6 +19,11 @@ fsType = "ext4"; }; + fileSystems."/nas" = { + device = "192.168.1.71:/volume1/ame"; + fsType = "nfs"; + }; + fileSystems."/boot/efi" = { device = "/dev/disk/by-uuid/4D09-1D57"; fsType = "vfat"; diff --git a/hosts/ame/home.nix b/hosts/ame/home.nix index 525f8d0..6ab79c2 100755 --- a/hosts/ame/home.nix +++ b/hosts/ame/home.nix @@ -1,7 +1,6 @@ {pkgs, ...}: { imports = [ ../../home - ../../home/librewolf ../../home/wezterm ../../home/zathura ../../home/lf @@ -19,6 +18,7 @@ username = "notoh"; homeDirectory = "/home/notoh"; packages = with pkgs; [ + brave webcord discord spotify-player diff --git a/hosts/ame/services/default.nix b/hosts/ame/services/default.nix new file mode 100644 index 0000000..3175140 --- /dev/null +++ b/hosts/ame/services/default.nix @@ -0,0 +1,5 @@ +{...}: { + imports = [ + ./restic.nix + ]; +} diff --git a/hosts/ame/services/restic.nix b/hosts/ame/services/restic.nix new file mode 100644 index 0000000..84c8c9f --- /dev/null +++ b/hosts/ame/services/restic.nix @@ -0,0 +1,40 @@ +{ + pkgs, + config, + ... +}: { + sops.secrets.restic-repo-pwd = {}; + environment.systemPackages = [pkgs.restic]; + services.restic = { + backups = { + ame = { + paths = [ + "/home" + ]; + exclude = [ + "*.qcow2" + "*.iso" + "/home/*/Downloads" + "/home/*/Videos" + "/home/*/.cache" + "/home/*/.rustup" + "/home/*/.cargo" + "/home/*/.mplayer" + "/home/*/.local/share/Trash" + "/home/*/.local/share/.var" + ]; + pruneOpts = [ + "--keep-daily=4" + "--keep-weekly=3" + "--keep-monthly=2" + ]; + initialize = true; + repository = "/nas/home"; + passwordFile = config.sops.secrets.restic-repo-pwd.path; + timerConfig = { + OnCalendar = "daily"; + }; + }; + }; + }; +}