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:
16
modules/desktop/userdirs.nix
Normal file
16
modules/desktop/userdirs.nix
Normal 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;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user