commit 0652060d33271fb60cab4807a4782812a9ea43ce parent f9a1f35dfe91ffe8aef1849b256a725cb959b185 Author: Chris <chris@echoz.io> Date: Tue, 7 Oct 2025 04:43:28 +0200 feat: persist xdg user dirs Diffstat:
| M | modules/xdg-user-dirs/default.nix | | | 74 | ++++++++++++++++++++++++++++++++++++++++++++------------------------------ |
1 file changed, 44 insertions(+), 30 deletions(-)
diff --git a/modules/xdg-user-dirs/default.nix b/modules/xdg-user-dirs/default.nix @@ -6,38 +6,52 @@ ... }: { - config = { - home-manager.users.${user}.xdg.userDirs = - let - tilde = config.home-manager.users.${user}.home.homeDirectory; - in - { - enable = true; - createDirectories = true; + home-manager.users.${user}.xdg.userDirs = + let + tilde = config.home-manager.users.${user}.home.homeDirectory; + in + { + enable = true; + createDirectories = true; - # cli friendly names - documents = "${tilde}/doc"; - download = "${tilde}/dls"; - music = "${tilde}/mus"; - pictures = "${tilde}/pic"; - videos = "${tilde}/vid"; + # cli friendly names + documents = "${tilde}/doc"; + download = "${tilde}/dls"; + music = "${tilde}/mus"; + pictures = "${tilde}/pic"; + videos = "${tilde}/vid"; - # some non-standard ones that should be there - extraConfig = { - XDG_GIT_DIR = "${tilde}/git"; - XDG_TMP_DIR = "${tilde}/tmp"; - XDG_MNT_DIR = "${tilde}/mnt"; + # some non-standard ones that should be there + extraConfig = { + XDG_GIT_DIR = "${tilde}/git"; + XDG_TMP_DIR = "${tilde}/tmp"; + XDG_MNT_DIR = "${tilde}/mnt"; - # important git repos - XDG_DOT_DIR = "${tilde}/dot"; - XDG_SEC_DIR = "${tilde}/sec"; - XDG_SRV_DIR = "${tilde}/srv"; - }; - - # map useless dirs to tmp - desktop = "${tilde}/tmp"; - publicShare = "${tilde}/tmp"; - templates = "${tilde}/tmp"; + # important git repos + XDG_DOT_DIR = "${tilde}/dot"; + XDG_SEC_DIR = "${tilde}/sec"; + XDG_SRV_DIR = "${tilde}/srv"; }; - }; + + # map useless dirs to tmp + desktop = "${tilde}/tmp"; + publicShare = "${tilde}/tmp"; + templates = "${tilde}/tmp"; + }; + + environment.persistence."/fix".users.${user}.directories = + builtins.map + (directory: { + inherit directory; + mode = "0700"; + }) + [ + "mus" + "pic" + "vid" + "git" + "dot" + "sec" + "srv" + ]; }