Expand xdg config
Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
@@ -5,46 +5,31 @@ let
|
||||
in
|
||||
{
|
||||
home-manager.users = lib.attrsets.mapAttrs
|
||||
(user: cfg: (
|
||||
let
|
||||
cacheHome = "${cfg.home}/.cache";
|
||||
configHome = "${cfg.home}/.config";
|
||||
dataHome = "${cfg.home}/.local/share";
|
||||
stateHome = "${cfg.home}/.local/state";
|
||||
xdgVmDir = "${cfg.home}/VMs";
|
||||
xdgGitDir = "${cfg.home}/git";
|
||||
in
|
||||
{
|
||||
xdg = {
|
||||
(user: cfg: ({
|
||||
xdg = {
|
||||
enable = true;
|
||||
mimeApps.enable = true;
|
||||
|
||||
userDirs = {
|
||||
enable = true;
|
||||
mimeApps.enable = true;
|
||||
|
||||
inherit cacheHome;
|
||||
inherit configHome;
|
||||
inherit dataHome;
|
||||
inherit stateHome;
|
||||
|
||||
userDirs = {
|
||||
enable = true;
|
||||
extraConfig = {
|
||||
XDG_VM_DIR = xdgVmDir;
|
||||
XDG_GIT_DIR = xdgGitDir;
|
||||
};
|
||||
extraConfig = {
|
||||
XDG_VM_DIR = "${cfg.home}/VMs";
|
||||
XDG_GIT_DIR = "${cfg.home}/git";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
home.persistence."/persist${cfg.home}".directories = [
|
||||
"Desktop" # userDirs.desktop
|
||||
"Documents" # userDirs.documents
|
||||
"Downloads" # userDirs.download
|
||||
"Music" # userDirs.music
|
||||
"Pictures" # userDirs.pictures
|
||||
"Templates" # userDirs.templates
|
||||
"Videos" # userDirs.videos
|
||||
"VMs" # xdgVmDir
|
||||
"git" # xdgGitDir
|
||||
];
|
||||
}
|
||||
))
|
||||
home.persistence."/persist${cfg.home}".directories = [
|
||||
"Desktop" # userDirs.desktop
|
||||
"Documents" # userDirs.documents
|
||||
"Downloads" # userDirs.download
|
||||
"Music" # userDirs.music
|
||||
"Pictures" # userDirs.pictures
|
||||
"Templates" # userDirs.templates
|
||||
"Videos" # userDirs.videos
|
||||
"VMs"
|
||||
"git"
|
||||
];
|
||||
}))
|
||||
users;
|
||||
}
|
||||
|
@@ -15,6 +15,7 @@
|
||||
useGlobalPkgs = true;
|
||||
sharedModules = [{
|
||||
imports = [
|
||||
./options/home-manager/xdg
|
||||
./options/home-manager/matugen
|
||||
./options/home-manager/theme
|
||||
];
|
||||
|
@@ -247,7 +247,6 @@ in
|
||||
fi
|
||||
|
||||
${cfg.extraConfig}
|
||||
$
|
||||
'';
|
||||
};
|
||||
in
|
||||
|
48
users/common/options/home-manager/xdg/default.nix
Normal file
48
users/common/options/home-manager/xdg/default.nix
Normal file
@@ -0,0 +1,48 @@
|
||||
{ config, lib, ... }:
|
||||
|
||||
let
|
||||
cfg = config.xdg;
|
||||
in
|
||||
{
|
||||
options.xdg = with lib; with types; {
|
||||
relativeCacheHome = mkOption {
|
||||
type = str;
|
||||
default = ".cache";
|
||||
description = "Relative path to directory holding application caches.";
|
||||
};
|
||||
|
||||
cacheHome = mkOption {
|
||||
default = "${config.home.homeDirectory}/${cfg.relativeCacheHome}";
|
||||
};
|
||||
|
||||
relativeConfigHome = mkOption {
|
||||
type = str;
|
||||
default = ".config";
|
||||
description = "Relative path to directory holding application configurations.";
|
||||
};
|
||||
|
||||
configHome = mkOption {
|
||||
default = "${config.home.homeDirectory}/${cfg.relativeConfigHome}";
|
||||
};
|
||||
|
||||
relativeDataHome = mkOption {
|
||||
type = str;
|
||||
default = ".local/share";
|
||||
description = "Relative path to directory holding application data.";
|
||||
};
|
||||
|
||||
dataHome = mkOption {
|
||||
default = "${config.home.homeDirectory}/${cfg.relativeDataHome}";
|
||||
};
|
||||
|
||||
relativeStateHome = mkOption {
|
||||
type = str;
|
||||
default = ".local/state";
|
||||
description = "Relative path to directory holding application states.";
|
||||
};
|
||||
|
||||
stateHome = mkOption {
|
||||
default = "${config.home.homeDirectory}/${cfg.relativeStateHome}";
|
||||
};
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user