feat: massive refactor

This commit is contained in:
2025-12-20 12:57:47 +08:00
parent f4c1b313ce
commit 454ad5885d
97 changed files with 1023 additions and 960 deletions

60
modules/core/xdg.nix Normal file
View File

@@ -0,0 +1,60 @@
{
lib,
config,
pkgs,
username,
...
}:
let
cfg = config.my.xdg;
in
{
options.my.xdg = {
enable = lib.mkEnableOption "xdg";
defaultApplications = lib.mkOption {
type = lib.types.attrs;
default = { };
};
extraBookmarks = lib.mkOption {
type = with lib.types; listOf str;
default = [ ];
};
};
config = lib.mkIf cfg.enable {
my.hm =
let
homedir = config.my.hm.home.homeDirectory;
in
{
home.packages = with pkgs; [
xdg-utils # `xdg-mime` `xdg-open` and so on
];
xdg = {
enable = true;
cacheHome = "${homedir}/.cache";
configHome = "${homedir}/.config";
dataHome = "${homedir}/.local/share";
stateHome = "${homedir}/.local/state";
userDirs.enable = true;
configFile."mimeapps.list".force = true;
mimeApps = {
enable = true;
inherit (cfg) defaultApplications;
};
};
gtk.gtk3.bookmarks = [
"file://${homedir}/Documents "
"file://${homedir}/Downloads "
"file://${homedir}/Pictures "
"file://${homedir}/Videos "
"file://${homedir}/Music "
"file://${homedir}/workspace "
];
};
};
}