feat: xdg
This commit is contained in:
parent
93ba9bfdaa
commit
6be6e4db46
2 changed files with 13 additions and 15 deletions
|
@ -1,5 +1,6 @@
|
|||
{
|
||||
imports = [
|
||||
./session.nix
|
||||
./xdg.nix
|
||||
];
|
||||
}
|
||||
|
|
|
@ -1,42 +1,39 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
system,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.snowfall.system) is-linux;
|
||||
|
||||
inherit (config.marleyos) isDesktop;
|
||||
inherit (config.marleycfg) profiles;
|
||||
in {
|
||||
config = {
|
||||
home.preferXdgDirectories = true;
|
||||
|
||||
xdg = let
|
||||
homeDir = config.home.homeDirectory;
|
||||
home = config.home.homeDirectory;
|
||||
in
|
||||
lib.mkMerge [
|
||||
{
|
||||
enable = true;
|
||||
|
||||
cacheHome = "${homeDir}/.cache";
|
||||
configHome = "${homeDir}/.config";
|
||||
dataHome = "${homeDir}/.local/share";
|
||||
stateHome = "${homeDir}/.local/state";
|
||||
cacheHome = "${home}/.cache";
|
||||
configHome = "${home}/.config";
|
||||
dataHome = "${home}/.local/share";
|
||||
stateHome = "${home}/.local/state";
|
||||
}
|
||||
|
||||
(lib.mkIf (isDesktop && (is-linux system)) {
|
||||
(lib.mkIf (profiles.desktop && pkgs.stdenv.isLinux) {
|
||||
userDirs = {
|
||||
enable = true;
|
||||
createDirectories = true;
|
||||
|
||||
desktop = "${homeDir}/desktop";
|
||||
desktop = "${home}/desktop";
|
||||
documents = null;
|
||||
download = "${homeDir}/downloads";
|
||||
download = "${home}/downloads";
|
||||
music = null;
|
||||
pictures = "${homeDir}/pictures";
|
||||
pictures = "${home}/pictures";
|
||||
templates = null;
|
||||
videos = "${homeDir}/videos";
|
||||
videos = "${home}/videos";
|
||||
};
|
||||
|
||||
portal = {
|
||||
|
@ -50,7 +47,7 @@ in {
|
|||
enable = true;
|
||||
|
||||
associations.added = let
|
||||
browser = "${lib.getName config.marleyos.apps.browser}";
|
||||
browser = "${lib.getName config.marleycfg.apps.browser}";
|
||||
in {
|
||||
"application/json" = ["nvim.desktop"];
|
||||
"application/pdf" = ["org.pwmt.zathura-pdf-mupdf.desktop"];
|
Loading…
Reference in a new issue