Move some (all) files around
Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
34
hosts/common/user/configs/console/xdg/default.nix
Normal file
34
hosts/common/user/configs/console/xdg/default.nix
Normal file
@@ -0,0 +1,34 @@
|
||||
{
|
||||
user ? throw "user argument is required",
|
||||
}:
|
||||
{ config, lib, ... }:
|
||||
{
|
||||
home-manager.users.${user.name} = {
|
||||
imports = [ ./options.nix ];
|
||||
|
||||
xdg = {
|
||||
enable = true;
|
||||
mimeApps.enable = true;
|
||||
|
||||
userDirs = {
|
||||
enable = true;
|
||||
extraConfig = {
|
||||
XDG_VM_DIR = "${user.home}/VMs";
|
||||
XDG_GIT_DIR = "${user.home}/git";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
home.persistence."/persist${user.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"
|
||||
];
|
||||
};
|
||||
}
|
42
hosts/common/user/configs/console/xdg/options.nix
Normal file
42
hosts/common/user/configs/console/xdg/options.nix
Normal file
@@ -0,0 +1,42 @@
|
||||
{ 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