Files
sydnix/users/crumb/files.nix
Madeleine Sydney d203a71aaa feat: Encryption
2025-02-18 15:59:17 -07:00

76 lines
2.3 KiB
Nix
Executable File

{ config, lib, pkgs, ... }:
let mutableSymlink = config.lib.file.mkOutOfStoreSymlink;
in lib.mkMerge [
{
### Some basic impermanence setup.
sydnix.impermanence = {
enable = true;
directories = [
"Music"
"Pictures"
"Documents"
"Videos"
"src"
# Should "org" be declared in emacs.nix? I don't think so. I
# conjecture that my org files are extremely valuable with or without
# Emacs.
"org"
".ssh"
{
directory = ".local/share/Steam";
method = "symlink";
}
".passage"
];
};
}
{
### Syncthing
# TODO: sydnix.syncthing module
sydnix.impermanence.directories =
let xdg-state-dir =
"${config.home.stateHome
or "${config.home.homeDirectory}/.local/state"}";
in [
# HACK: This relies on behaviour that is not explicitly defined by the
# Syncthing Home-manager module. We have to trust that $XDG_STATE_DIR,
# at the time of syncthing.service's start, does not differ from this
# value defined in Nix. Perhaps a PR to home-manager adding an option
# `services.syncthing.stateDir` would be good.
#
# If Syncthing ever breaks, make sure they didn't start using a different path:
# https://github.com/nix-community/home-manager/blob/master/modules/services/syncthing.nix
#
# Evidence for using this path is found at: (permalink)
# https://github.com/nix-community/home-manager/blob/6d3163aea47fdb1fe19744e91306a2ea4f602292/modules/services/syncthing.nix#L624
# Hack aside, this directory must be persisted to, at least
# 1. Preserve the device ID.
(lib.removePrefix config.home.homeDirectory "${xdg-state-dir}/syncthing")
];
services.syncthing = {
enable = true;
settings = {
overrideDevices = true;
overrideFolders = true;
devices = {
"guix-rebound".id =
"Q5B6LIV-5HQMWWV-XFQL5IT-PHP7PVE-XFWUVHK-F6WJ42C-OPMR4M7-GFNK3AG";
};
folders = {
"org" = {
path = "~/org";
devices = [ "guix-rebound" ];
ignorePerms = true;
};
};
};
};
}
]