feat(desktop): resolve media output paths through XDG user-dirs

Add a modules.desktop.userdirs module that declares the XDG user directories,
and route the recorder and screenshot tools through xdg-user-dir so their
output folders (Videos/Recordings, Pictures/Screenshots) follow one relocatable
source instead of a hardcoded $HOME path.
This commit was merged in pull request #21.
This commit is contained in:
2026-07-22 23:11:16 -04:00
parent 0e92de7eea
commit ab89ba8391
5 changed files with 28 additions and 9 deletions

View File

@@ -0,0 +1,16 @@
{ config, lib, ... }:
# Declares the XDG user directories, so a tool that queries them lands in a
# well-known folder a host can relocate from one place.
let
cfg = config.modules.desktop.userdirs;
user = config.user.name;
in
{
options.modules.desktop.userdirs.enable = lib.mkEnableOption "XDG user directories";
config = lib.mkIf cfg.enable {
# enable writes ~/.config/user-dirs.dirs from the option defaults, which
# xdg-user-dir then reads.
home-manager.users.${user}.xdg.userDirs.enable = true;
};
}