diff options
Diffstat (limited to 'modules/common/common/xdg.nix')
-rw-r--r-- | modules/common/common/xdg.nix | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/modules/common/common/xdg.nix b/modules/common/common/xdg.nix new file mode 100644 index 0000000..04ca544 --- /dev/null +++ b/modules/common/common/xdg.nix @@ -0,0 +1,53 @@ +{ + config, + lib, + ... +}: +with lib; { + imports = let + withBase = a: ["nixfiles" "modules" "common" "xdg" a]; + in [ + (mkAliasOptionModule ["dirs" "cache"] (withBase "cacheHome")) + (mkAliasOptionModule ["dirs" "config"] (withBase "configHome")) + (mkAliasOptionModule ["dirs" "data"] (withBase "dataHome")) + (mkAliasOptionModule ["dirs" "state"] (withBase "stateHome")) + (mkAliasOptionModule ["userDirs"] (withBase "userDirs")) + ]; + + options.nixfiles.modules.common.xdg = { + cacheHome = mkOption { + type = types.str; + default = "${config.hm.home.homeDirectory}/.cache"; + }; + configHome = mkOption { + type = types.str; + default = "${config.hm.home.homeDirectory}/.config"; + }; + dataHome = mkOption { + type = types.str; + default = "${config.hm.home.homeDirectory}/.local/share"; + }; + stateHome = mkOption { + type = types.str; + default = "${config.hm.home.homeDirectory}/.local/state"; + }; + userDirs = mkOption { + type = types.attrs; + default = let + inherit (config.my) home; + tmp = home + "/tmp"; + in { + enable = true; + + desktop = tmp; + documents = "${home}/doc"; + download = tmp; + music = tmp; + pictures = tmp; + publicShare = "${home}/share"; + templates = tmp; + videos = tmp; + }; + }; + }; +} |