1
0
Fork 0
nixos-config/home-manager/roles/state.nix

63 lines
1.9 KiB
Nix
Raw Normal View History

2022-03-08 01:42:46 +00:00
defaultMode: {
lib,
config,
...
}: let
2021-07-04 21:52:41 +00:00
# Persistent means that files get snapshoted and kept for a month
# Volatile means that files just lay on the disk
# Backups are organized independently on this system
2021-07-05 15:45:47 +00:00
home = config.home.homeDirectory;
2021-07-05 16:19:31 +00:00
persistentStateDirs = [
2021-08-26 09:39:39 +00:00
".aqbanking"
2021-07-05 16:19:31 +00:00
".calendars"
".config/Element"
2021-07-15 22:02:13 +00:00
".config/Mumble"
2021-07-09 12:13:51 +00:00
".config/Signal"
2021-07-05 16:19:31 +00:00
".config/discord"
2021-10-08 09:59:04 +00:00
".config/gh"
2021-07-05 16:19:31 +00:00
".contacts"
".gnupg"
2022-01-31 16:57:45 +00:00
".config/mpv/watch_later"
2021-07-09 12:13:51 +00:00
".local/share/Mumble"
".local/share/TelegramDesktop"
2021-07-05 16:19:31 +00:00
".local/share/direnv"
2021-07-15 22:02:13 +00:00
".local/share/khal"
".local/share/mpd"
2021-12-12 22:41:28 +00:00
".local/share/waydroid"
2022-01-28 15:27:43 +00:00
".local/share/newsboat"
2021-07-19 22:16:43 +00:00
".mozilla/firefox/maralorn-default"
2021-12-09 19:01:13 +00:00
".minecraft"
2021-07-05 16:19:31 +00:00
".ssh"
".task"
".vdirsyncer"
".vimhist"
2021-07-09 12:13:51 +00:00
".zoom"
".zotero/zotero"
2021-07-05 16:19:31 +00:00
"Maildir"
"git"
"media"
];
2022-03-08 01:42:46 +00:00
persistentStateFiles = [".chpwd-recent-dirs" ".zsh_history"];
volatileStateFiles = [];
volatileStateDirs = [".steam" ".local/share/Steam"];
2021-07-04 21:52:41 +00:00
mkLine = type: to: from: "${type} ${to} - - - - ${from}";
2022-03-08 01:42:46 +00:00
mkEntry = type: persistence: name: let
target = "/disk/${persistence}/maralorn/${name}";
in [(mkLine "L+" "${home}/${name}" target) (mkLine type target "")];
in {
systemd.user.tmpfiles.rules =
lib.concatLists
2021-07-04 21:52:41 +00:00
(
2021-07-05 16:19:31 +00:00
map (mkEntry "f" "volatile") volatileStateFiles ++ map (mkEntry "d" "volatile") volatileStateDirs ++ map (mkEntry "f" "persist") persistentStateFiles ++ map (mkEntry "d" "persist") persistentStateDirs
2022-03-08 01:42:46 +00:00
)
++ [
(mkLine "L+" "${home}/.password-store" "git/password-store")
(mkLine "L+" "${home}/.volatile" "/disk/volatile/maralorn")
(mkLine "L+" "${home}/.config/nixpkgs/home.nix" "${home}/git/config/home.nix")
(mkLine "L+" "${home}/.persist" "/disk/persist/maralorn")
(mkLine "f" "${home}/.mode" defaultMode)
(mkLine "f" "${home}/.config/lazygit/state.yml" "startuppopupversion: 5")
(mkLine "d" "${home}/.cache/mutt" "")
];
2021-07-04 21:52:41 +00:00
}