feat: xdg

This commit is contained in:
punkfairie 2025-05-26 11:29:47 -07:00
parent 93ba9bfdaa
commit 6be6e4db46
Signed by: punkfairie
GPG key ID: B3C5488E9A1A7CA6
2 changed files with 13 additions and 15 deletions

View file

@ -1,5 +1,6 @@
{ {
imports = [ imports = [
./session.nix ./session.nix
./xdg.nix
]; ];
} }

View file

@ -1,42 +1,39 @@
{ {
config, config,
lib, lib,
system,
pkgs, pkgs,
... ...
}: let }: let
inherit (lib.snowfall.system) is-linux; inherit (config.marleycfg) profiles;
inherit (config.marleyos) isDesktop;
in { in {
config = { config = {
home.preferXdgDirectories = true; home.preferXdgDirectories = true;
xdg = let xdg = let
homeDir = config.home.homeDirectory; home = config.home.homeDirectory;
in in
lib.mkMerge [ lib.mkMerge [
{ {
enable = true; enable = true;
cacheHome = "${homeDir}/.cache"; cacheHome = "${home}/.cache";
configHome = "${homeDir}/.config"; configHome = "${home}/.config";
dataHome = "${homeDir}/.local/share"; dataHome = "${home}/.local/share";
stateHome = "${homeDir}/.local/state"; stateHome = "${home}/.local/state";
} }
(lib.mkIf (isDesktop && (is-linux system)) { (lib.mkIf (profiles.desktop && pkgs.stdenv.isLinux) {
userDirs = { userDirs = {
enable = true; enable = true;
createDirectories = true; createDirectories = true;
desktop = "${homeDir}/desktop"; desktop = "${home}/desktop";
documents = null; documents = null;
download = "${homeDir}/downloads"; download = "${home}/downloads";
music = null; music = null;
pictures = "${homeDir}/pictures"; pictures = "${home}/pictures";
templates = null; templates = null;
videos = "${homeDir}/videos"; videos = "${home}/videos";
}; };
portal = { portal = {
@ -50,7 +47,7 @@ in {
enable = true; enable = true;
associations.added = let associations.added = let
browser = "${lib.getName config.marleyos.apps.browser}"; browser = "${lib.getName config.marleycfg.apps.browser}";
in { in {
"application/json" = ["nvim.desktop"]; "application/json" = ["nvim.desktop"];
"application/pdf" = ["org.pwmt.zathura-pdf-mupdf.desktop"]; "application/pdf" = ["org.pwmt.zathura-pdf-mupdf.desktop"];