mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-08-30 07:07:20 +02:00
refactor(home): share XDG base configuration
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
{ config, ... }:
|
||||
{
|
||||
xdg = {
|
||||
enable = true;
|
||||
cacheHome = "${config.home.homeDirectory}/.cache";
|
||||
configHome = "${config.home.homeDirectory}/.config";
|
||||
dataHome = "${config.home.homeDirectory}/.local/share";
|
||||
stateHome = "${config.home.homeDirectory}/.local/state";
|
||||
};
|
||||
}
|
||||
@@ -17,7 +17,4 @@
|
||||
../base/gui
|
||||
../base/home.nix
|
||||
];
|
||||
|
||||
# enable management of XDG base directories on macOS.
|
||||
xdg.enable = true;
|
||||
}
|
||||
|
||||
@@ -16,21 +16,12 @@
|
||||
xdg-user-dirs
|
||||
];
|
||||
|
||||
xdg = {
|
||||
xdg.userDirs = {
|
||||
enable = true;
|
||||
|
||||
cacheHome = "${config.home.homeDirectory}/.cache";
|
||||
configHome = "${config.home.homeDirectory}/.config";
|
||||
dataHome = "${config.home.homeDirectory}/.local/share";
|
||||
stateHome = "${config.home.homeDirectory}/.local/state";
|
||||
|
||||
userDirs = {
|
||||
enable = true;
|
||||
setSessionVariables = true;
|
||||
createDirectories = true;
|
||||
extraConfig = {
|
||||
SCREENSHOTS = "${config.xdg.userDirs.pictures}/Screenshots";
|
||||
};
|
||||
setSessionVariables = true;
|
||||
createDirectories = true;
|
||||
extraConfig = {
|
||||
SCREENSHOTS = "${config.xdg.userDirs.pictures}/Screenshots";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
{ myvars, lib }:
|
||||
let
|
||||
username = myvars.username;
|
||||
in
|
||||
lib.genAttrs
|
||||
[
|
||||
"ai-niri"
|
||||
"aquamarine"
|
||||
"ruby"
|
||||
]
|
||||
(_: {
|
||||
enable = true;
|
||||
stateHome = "/home/${username}/.local/state";
|
||||
})
|
||||
@@ -0,0 +1,19 @@
|
||||
{
|
||||
myvars,
|
||||
lib,
|
||||
outputs,
|
||||
}:
|
||||
let
|
||||
username = myvars.username;
|
||||
hosts = [
|
||||
"ai-niri"
|
||||
"aquamarine"
|
||||
"ruby"
|
||||
];
|
||||
in
|
||||
lib.genAttrs hosts (name: {
|
||||
inherit (outputs.nixosConfigurations.${name}.config.home-manager.users.${username}.xdg)
|
||||
enable
|
||||
stateHome
|
||||
;
|
||||
})
|
||||
Reference in New Issue
Block a user