From 2d2f7291382d5f8f0f4de01a1adb2184a67cd4f4 Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Wed, 8 Mar 2023 14:36:27 +0000 Subject: [PATCH] home: zsh: don't hard-code '$XDG_CONFIG_HOME' --- home/zsh/default.nix | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/home/zsh/default.nix b/home/zsh/default.nix index c854c40..6713458 100644 --- a/home/zsh/default.nix +++ b/home/zsh/default.nix @@ -1,6 +1,14 @@ { config, pkgs, lib, ... }: let cfg = config.my.home.zsh; + + # Have a nice relative path for XDG_CONFIG_HOME, without leading `/` + relativeXdgConfig = + let + noHome = lib.removePrefix config.home.homeDirectory; + noSlash = lib.removePrefix "/"; + in + noSlash (noHome config.xdg.configHome); in { options.my.home.zsh = with lib; { @@ -16,7 +24,7 @@ in programs.zsh = { enable = true; - dotDir = ".config/zsh"; # Don't clutter $HOME + dotDir = "${relativeXdgConfig}/zsh"; # Don't clutter $HOME enableCompletion = true; history = {