summaryrefslogtreecommitdiff
path: root/hm/conf/xdg-dirs.nix
blob: 3a37e6ae2978b331df824f8e1c170bc409fb9b54 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
{ config, lib, ... }:
let
  cfg = config.hm.conf.xdg-dirs;
in
{
  options.hm.conf.xdg-dirs = {
    enable = lib.mkEnableOption "enables xdg dirs";

    storagePath = lib.mkOption {
      type = lib.types.path;
      default = config.home.homeDirectory;
      description = "base path for storage";
    };
  };
  config = lib.mkIf cfg.enable {
    xdg.userDirs = {
      enable = true;
      createDirectories = true;

      download = "${config.home.homeDirectory}/dl";
      documents = "${config.home.homeDirectory}/dc";

      pictures = "${toString cfg.storagePath}/pics";
      videos = "${toString cfg.storagePath}/vids";

      desktop = null;
      music = null;
      publicShare = null;
      templates = null;

      extraConfig = {
        DEV = "${config.home.homeDirectory}/dv";
        GAMES = "${config.home.homeDirectory}/games";
        storage = "${toString cfg.storagePath}";
        SS = "${toString cfg.storagePath}/pics/ss";
        CLIPS = "${toString cfg.storagePath}/vids/clips";
        MOVIES = "${toString cfg.storagePath}/movies";
        ANIME = "${toString cfg.storagePath}/anime";
        ARCHIVE = "${toString cfg.storagePath}/archive";
      };
    };
  };
}