Update hardcoded xdg paths

Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
2024-07-31 20:14:13 +00:00
parent f6d1a13d76
commit d5fa60df4c
6 changed files with 41 additions and 18 deletions

View File

@@ -7,6 +7,9 @@
pkgs,
...
}:
let
hmConfig = config.home-manager.users.${username};
in
{
virtualisation.docker.rootless = {
enable = true;
@@ -26,7 +29,9 @@
};
};
environment.persistence."/persist".users.${username}.directories = [ ".local/share/docker" ];
environment.persistence."/persist".users.${username}.directories = [
"${hmConfig.xdg.relativeDataHome}/docker"
];
home-manager.users.${username}.home.packages = with pkgs; [ docker-compose ];
}

View File

@@ -9,7 +9,8 @@
}:
let
userConfig = config.users.users.${username};
sopsKeyPath = ".config/sops-nix/key.txt";
hmConfig = config.home-manager.users.${username};
sopsKeyPath = "${hmConfig.xdg.relativeConfigHome}/sops-nix/key.txt";
in
{
environment.persistence."/persist".users.${username}.files = [ sopsKeyPath ];

View File

@@ -9,24 +9,28 @@ in
{
relativeCacheHome = mkOption {
type = str;
readOnly = true;
default = ".cache";
description = "Relative path to directory holding application caches.";
};
relativeConfigHome = mkOption {
type = str;
readOnly = true;
default = ".config";
description = "Relative path to directory holding application configurations.";
};
relativeDataHome = mkOption {
type = str;
readOnly = true;
default = ".local/share";
description = "Relative path to directory holding application data.";
};
relativeStateHome = mkOption {
type = str;
readOnly = true;
default = ".local/state";
description = "Relative path to directory holding application states.";
};
@@ -34,42 +38,49 @@ in
userDirs = {
relativeDesktop = mkOption {
type = str;
readOnly = true;
default = "Desktop";
description = "Relative path to the Desktop directory.";
};
relativeDocuments = mkOption {
type = str;
readOnly = true;
default = "Documents";
description = "Relative path to the Documents directory.";
};
relativeDownload = mkOption {
type = str;
readOnly = true;
default = "Downloads";
description = "Relative path to the Downloads directory.";
};
relativeMusic = mkOption {
type = str;
readOnly = true;
default = "Music";
description = "Relative path to the Music directory.";
};
relativePictures = mkOption {
type = str;
readOnly = true;
default = "Pictures";
description = "Relative path to the Pictures directory.";
};
relativeTemplates = mkOption {
type = str;
readOnly = true;
default = "Templates";
description = "Relative path to the Templates directory.";
};
relativeVideos = mkOption {
type = str;
readOnly = true;
default = "Videos";
description = "Relative path to the Videos directory.";
};

View File

@@ -1,7 +1,10 @@
{
username ? throw "username argument is required",
}:
{ ... }:
{ config, ... }:
let
hmConfig = config.home-manager.users.${username};
in
{
programs.chromium = {
enable = true;
@@ -19,8 +22,8 @@
};
environment.persistence = {
"/persist".users.${username}.directories = [ ".config/chromium" ];
"/cache".users.${username}.directories = [ ".cache/chromium" ];
"/persist".users.${username}.directories = [ "${hmConfig.xdg.relativeConfigHome}/chromium" ];
"/cache".users.${username}.directories = [ "${hmConfig.xdg.relativeCacheHome}/chromium" ];
};
home-manager.users.${username} = {

View File

@@ -7,10 +7,13 @@
pkgs,
...
}:
let
hmConfig = config.home-manager.users.${username};
in
{
environment.persistence = {
"/persist".users.${username}.directories = [ ".mozilla" ];
"/cache".users.${username}.directories = [ ".cache/mozilla" ];
"/cache".users.${username}.directories = [ "${hmConfig.xdg.relativeCacheHome}/mozilla" ];
};
home-manager.users.${username} = {

View File

@@ -12,20 +12,20 @@ let
in
{
environment.persistence = {
"/persist".users.${username}.directories = [ ".config/Code" ];
"/persist".users.${username}.directories = [ "${hmConfig.xdg.relativeConfigHome}/Code" ];
# Bastard: https://github.com/microsoft/vscode/issues/3884
"/cache".users.${username}.directories = [
".config/Code/Cache"
".config/Code/CachedConfigurations"
".config/Code/CachedData"
".config/Code/CachedExtensionVSIXs"
".config/Code/CachedExtensions"
".config/Code/CachedProfilesData"
".config/Code/Code Cache"
".config/Code/DawnCache"
".config/Code/GPUCache"
".config/Code/Service Worker/CacheStorage"
".config/Code/Service Worker/ScriptCache"
"${hmConfig.xdg.relativeConfigHome}/Code/Cache"
"${hmConfig.xdg.relativeConfigHome}/Code/CachedConfigurations"
"${hmConfig.xdg.relativeConfigHome}/Code/CachedData"
"${hmConfig.xdg.relativeConfigHome}/Code/CachedExtensionVSIXs"
"${hmConfig.xdg.relativeConfigHome}/Code/CachedExtensions"
"${hmConfig.xdg.relativeConfigHome}/Code/CachedProfilesData"
"${hmConfig.xdg.relativeConfigHome}/Code/Code Cache"
"${hmConfig.xdg.relativeConfigHome}/Code/DawnCache"
"${hmConfig.xdg.relativeConfigHome}/Code/GPUCache"
"${hmConfig.xdg.relativeConfigHome}/Code/Service Worker/CacheStorage"
"${hmConfig.xdg.relativeConfigHome}/Code/Service Worker/ScriptCache"
];
};