96 lines
3.0 KiB
Nix
96 lines
3.0 KiB
Nix
{ config, lib, ... }:
|
|
let
|
|
cfg = config.xdg;
|
|
in
|
|
{
|
|
options.xdg =
|
|
with lib;
|
|
with types;
|
|
{
|
|
relativeCacheHome = mkOption {
|
|
type = str;
|
|
default = ".cache";
|
|
description = "Relative path to directory holding application caches.";
|
|
};
|
|
|
|
relativeConfigHome = mkOption {
|
|
type = str;
|
|
default = ".config";
|
|
description = "Relative path to directory holding application configurations.";
|
|
};
|
|
|
|
relativeDataHome = mkOption {
|
|
type = str;
|
|
default = ".local/share";
|
|
description = "Relative path to directory holding application data.";
|
|
};
|
|
|
|
relativeStateHome = mkOption {
|
|
type = str;
|
|
default = ".local/state";
|
|
description = "Relative path to directory holding application states.";
|
|
};
|
|
|
|
userDirs = {
|
|
relativeDesktop = mkOption {
|
|
type = str;
|
|
default = "Desktop";
|
|
description = "Relative path to the Desktop directory.";
|
|
};
|
|
|
|
relativeDocuments = mkOption {
|
|
type = str;
|
|
default = "Documents";
|
|
description = "Relative path to the Documents directory.";
|
|
};
|
|
|
|
relativeDownload = mkOption {
|
|
type = str;
|
|
default = "Downloads";
|
|
description = "Relative path to the Downloads directory.";
|
|
};
|
|
|
|
relativeMusic = mkOption {
|
|
type = str;
|
|
default = "Music";
|
|
description = "Relative path to the Music directory.";
|
|
};
|
|
|
|
relativePictures = mkOption {
|
|
type = str;
|
|
default = "Pictures";
|
|
description = "Relative path to the Pictures directory.";
|
|
};
|
|
|
|
relativeTemplates = mkOption {
|
|
type = str;
|
|
default = "Templates";
|
|
description = "Relative path to the Templates directory.";
|
|
};
|
|
|
|
relativeVideos = mkOption {
|
|
type = str;
|
|
default = "Videos";
|
|
description = "Relative path to the Videos directory.";
|
|
};
|
|
};
|
|
};
|
|
|
|
config.xdg = with lib; {
|
|
cacheHome = mkDefault "${config.home.homeDirectory}/${cfg.relativeCacheHome}";
|
|
configHome = mkDefault "${config.home.homeDirectory}/${cfg.relativeConfigHome}";
|
|
dataHome = mkDefault "${config.home.homeDirectory}/${cfg.relativeDataHome}";
|
|
stateHome = mkDefault "${config.home.homeDirectory}/${cfg.relativeStateHome}";
|
|
|
|
userDirs = {
|
|
desktop = mkDefault "${config.home.homeDirectory}/${cfg.userDirs.relativeDesktop}";
|
|
documents = mkDefault "${config.home.homeDirectory}/${cfg.userDirs.relativeDocuments}";
|
|
download = mkDefault "${config.home.homeDirectory}/${cfg.userDirs.relativeDownload}";
|
|
music = mkDefault "${config.home.homeDirectory}/${cfg.userDirs.relativeMusic}";
|
|
pictures = mkDefault "${config.home.homeDirectory}/${cfg.userDirs.relativePictures}";
|
|
templates = mkDefault "${config.home.homeDirectory}/${cfg.userDirs.relativeTemplates}";
|
|
videos = mkDefault "${config.home.homeDirectory}/${cfg.userDirs.relativeVideos}";
|
|
};
|
|
};
|
|
}
|