summaryrefslogtreecommitdiff
path: root/hm/conf/xdg-dirs.nix
diff options
context:
space:
mode:
authoradikro <adikro@disroot.org>2025-12-20 03:14:45 +0100
committeradikro <adikro@disroot.org>2025-12-20 03:14:45 +0100
commit791bc419b6dac7c70951981ef6b34cdf85828470 (patch)
tree56d0962fdf829ae942feb1344763e54dbc3c89a3 /hm/conf/xdg-dirs.nix
parente60410393cea222b16743a1a87f29c06b9b3543b (diff)
absolutely massive rewrite, made (almost) everything modular with changes to come
Diffstat (limited to 'hm/conf/xdg-dirs.nix')
-rw-r--r--hm/conf/xdg-dirs.nix51
1 files changed, 51 insertions, 0 deletions
diff --git a/hm/conf/xdg-dirs.nix b/hm/conf/xdg-dirs.nix
new file mode 100644
index 0000000..2bd9e64
--- /dev/null
+++ b/hm/conf/xdg-dirs.nix
@@ -0,0 +1,51 @@
+{ config, lib, ... }:
+let
+ cfg = config.szpont.hm.conf.xdg-dirs;
+in
+{
+ options.szpont.hm.conf.xdg-dirs = {
+ enable = lib.mkEnableOption "enables xdg dirs";
+
+ mediaPath = lib.mkOption {
+ type = lib.types.path;
+ default = config.home.homeDirectory;
+ description = "base path for media";
+ };
+ };
+
+ config = lib.mkIf cfg.enable {
+ xdg.userDirs = {
+ enable = true;
+ createDirectories = true;
+
+ download = "${config.home.homeDirectory}/dl";
+ documents = "${config.home.homeDirectory}/docs";
+
+ pictures = "${toString cfg.mediaPath}/pics";
+ videos = "${toString cfg.mediaPath}/vids";
+
+ desktop = null;
+ music = null;
+ publicShare = null;
+ templates = null;
+
+ extraConfig = {
+ XDG_PROJECTS_DIR = "${config.home.homeDirectory}/proj";
+ XDG_GAMES_DIR = "${config.home.homeDirectory}/games";
+ XDG_MEDIA_DIR = "${toString cfg.mediaPath}";
+ XDG_SS_DIR = "${toString cfg.mediaPath}/pics/ss";
+ XDG_CLIPS_DIR = "${toString cfg.mediaPath}/vids/clips";
+ XDG_ARCHIVE_DIR = "${toString cfg.mediaPath}/archive";
+ };
+ };
+ home.sessionVariables = {
+ XDG_PROJECTS_DIR = "${config.home.homeDirectory}/proj";
+ XDG_GAMES_DIR = "${config.home.homeDirectory}/games";
+ XDG_MEDIA_DIR = "${toString cfg.mediaPath}";
+ XDG_SS_DIR = "${toString cfg.mediaPath}/pics/ss";
+ XDG_CLIPS_DIR = "${toString cfg.mediaPath}/vids/clips";
+ XDG_ARCHIVE_DIR = "${toString cfg.mediaPath}/archive";
+ };
+
+ };
+}