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

60 lines
1.9 KiB
Nix
Raw Normal View History

2021-12-06 12:05:26 +00:00
defaultMode: { lib, config, ... }:
2021-07-04 21:52:41 +00:00
let
# 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"
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"
2021-07-19 22:16:43 +00:00
".mozilla/firefox/maralorn-default"
2021-12-09 19:01:13 +00:00
".minecraft"
2022-01-05 19:07:21 +00:00
".newsboat"
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"
];
2021-07-04 21:52:41 +00:00
persistentStateFiles = [ ".chpwd-recent-dirs" ".zsh_history" ];
volatileStateFiles = [ ];
volatileStateDirs = [ ".steam" ".local/share/Steam" ];
mkLine = type: to: from: "${type} ${to} - - - - ${from}";
mkEntry = type: persistence: name:
let
target = "/disk/${persistence}/maralorn/${name}";
in
2021-07-05 15:45:47 +00:00
[ (mkLine "L+" "${home}/${name}" target) (mkLine type target "") ];
2021-07-04 21:52:41 +00:00
in
{
systemd.user.tmpfiles.rules = lib.concatLists
(
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
2021-07-04 21:52:41 +00:00
) ++ [
2021-07-05 15:45:47 +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")
2021-12-06 12:05:26 +00:00
(mkLine "f" "${home}/.mode" defaultMode)
2021-07-10 10:39:02 +00:00
(mkLine "f" "${home}/.config/lazygit/state.yml" "startuppopupversion: 5")
2021-10-08 09:06:31 +00:00
(mkLine "d" "${home}/.cache/mutt" "")
2021-07-04 21:52:41 +00:00
];
}