diff options
author | Franck Cuny <franck@fcuny.net> | 2022-03-08 18:45:37 -0800 |
---|---|---|
committer | Franck Cuny <franck@fcuny.net> | 2022-03-08 18:45:37 -0800 |
commit | f61d21d17df6d476c5353718c89664719e7a7626 (patch) | |
tree | 31f0eca9a346932b8c06600777a288dedf6fcf79 | |
parent | backups: spread them so they don't clash (diff) | |
download | world-f61d21d17df6d476c5353718c89664719e7a7626.tar.gz |
nas: backup photos and music
Instead of rsync-ing these folders to a GCS bucket, I should instead do a backup. If I screw up something, the content will be sync-ed, and I won't be able to restore it. It's better (maybe more expensive, but that's OK) to keep snapshots and be able to restore.
Diffstat (limited to '')
-rw-r--r-- | hosts/common/nas.nix | 12 | ||||
-rw-r--r-- | users/fcuny/desktop/theme.nix | 106 |
2 files changed, 118 insertions, 0 deletions
diff --git a/hosts/common/nas.nix b/hosts/common/nas.nix index 2e1b6fc..f9017f2 100644 --- a/hosts/common/nas.nix +++ b/hosts/common/nas.nix @@ -17,4 +17,16 @@ group = "nas"; isSystemUser = true; }; + + services.restic.backups = { + media = { + paths = [ "/data/fast/music" "/data/fast/photos" ]; + repository = "/data/slow/backups/systems"; + passwordFile = config.age.secrets.restic-repo-systems.path; + timerConfig = { OnCalendar = "00:55"; }; + initialize = true; + extraBackupArgs = [ "--tag media" ]; + pruneOpts = [ "--keep-daily 7" "--keep-weekly 4" "--keep-monthly 12" ]; + }; + }; } diff --git a/users/fcuny/desktop/theme.nix b/users/fcuny/desktop/theme.nix new file mode 100644 index 0000000..0fb8478 --- /dev/null +++ b/users/fcuny/desktop/theme.nix @@ -0,0 +1,106 @@ +{ config, lib, ... }: +let + inherit (lib) mkOption mkMerge mkIf mkEnableOption types; + cfg = config.base16-theme; + cnotation = builtins.replaceStrings [ "#" ] [ "0x" ]; + color = default: + mkOption { + inherit default; + type = types.str; + }; + alpha = clr: a: "${clr}${a}"; +in { + options.base16-theme = { + enable = mkEnableOption "Enable base16 theme systemwide"; + base00 = color "#2E3440"; # polar night + base01 = color "#3B4252"; # polar night + base02 = color "#434C5E"; # polar night + base03 = color "#4C566A"; # polar night + base04 = color "#D8DEE9"; # snow storm + base05 = color "#E5E9F0"; # snow storm + base06 = color "#ECEFF4"; # snow storm + base07 = color "#8FBCBB"; # frost + base08 = color "#88C0D0"; # frost + base09 = color "#81A1C1"; # frost + base0A = color "#5E81AC"; # frost + base0B = color "#BF616A"; # aurora + base0C = color "#D08770"; # aurora + base0D = color "#EBCB8B"; # aurora + base0E = color "#A3BE8C"; # aurora + base0F = color "#B48EAD"; # aurora + }; + + config = mkIf cfg.enable (mkMerge [({ + wayland.windowManager.sway.config.colors = rec { + focused = { + border = cfg.base0A; + background = cfg.base0A; + text = cfg.base06; + indicator = cfg.base0A; + childBorder = cfg.base0A; + }; + + focusedInactive = { + border = cfg.base00; + background = cfg.base00; + text = cfg.base07; + indicator = cfg.base00; + childBorder = cfg.base00; + }; + + unfocused = focusedInactive; + + urgent = { + border = cfg.base0B; + background = cfg.base0B; + text = cfg.base05; + indicator = cfg.base0B; + childBorder = cfg.base0B; + }; + }; + + programs.alacritty.settings.colors = { + primary.background = "0x00374e"; # # special - not part of theme + primary.foreground = "0xD8DEE9"; + + cursor.text = cnotation cfg.base00; + cursor.cursor = cnotation cfg.base04; + + normal.black = cnotation cfg.base01; + normal.red = cnotation cfg.base0B; + normal.green = cnotation cfg.base0E; + normal.yellow = cnotation cfg.base0D; + normal.blue = cnotation cfg.base09; + normal.magenta = cnotation cfg.base0F; + normal.cyan = cnotation cfg.base08; + normal.white = cnotation cfg.base05; + + bright.black = cnotation cfg.base03; + bright.red = cnotation cfg.base0B; + bright.green = cnotation cfg.base0E; + bright.yellow = cnotation cfg.base0D; + bright.blue = cnotation cfg.base09; + bright.magenta = cnotation cfg.base0F; + bright.cyan = cnotation cfg.base07; + bright.white = cnotation cfg.base06; + }; + + programs.i3status-rust.bars.default.settings.theme.overrides = { + idle_bg = alpha cfg.base03 "DD"; + idle_fg = cfg.base05; + + info_bg = alpha cfg.base06 "DD"; + info_fg = cfg.base00; + + good_bg = alpha cfg.base09 "DD"; + good_fg = cfg.base00; + + warning_bg = alpha cfg.base0D "DD"; + warning_fg = cfg.base00; + + critical_bg = alpha cfg.base0B "DD"; + critical_fg = cfg.base04; + }; + })]); + +} |