From dc4337d9fed5b437913e51722fa150b9eae7d91c Mon Sep 17 00:00:00 2001 From: Lava Date: Mon, 28 Jun 2021 13:50:40 +0700 Subject: [PATCH] xresources: Add path configuration option (#2141) * xresources: Add path configuration option This allows the user to move .Xresources somewhere else, which can help with decluttering the home directory. * xresources: Update xresources.path docs * xresources: Fix formatting --- modules/xresources.nix | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/modules/xresources.nix b/modules/xresources.nix index 8a7e63216..ef91906e0 100644 --- a/modules/xresources.nix +++ b/modules/xresources.nix @@ -23,7 +23,7 @@ let toString v; in "${n}: ${formatValue v}"; - xrdbMerge = "${pkgs.xorg.xrdb}/bin/xrdb -merge ~/.Xresources"; + xrdbMerge = "${pkgs.xorg.xrdb}/bin/xrdb -merge ${cfg.path}"; in { meta.maintainers = [ maintainers.rycee ]; @@ -75,11 +75,19 @@ in { ~/.Xresources link is produced. ''; }; + + xresources.path = mkOption { + type = types.str; + default = "${config.home.homeDirectory}/.Xresources"; + defaultText = "$HOME/.Xresources"; + description = + "Path where Home Manager should link the .Xresources file."; + }; }; config = mkIf ((cfg.properties != null && cfg.properties != { }) || cfg.extraConfig != "") { - home.file.".Xresources" = { + home.file.${cfg.path} = { text = concatStringsSep "\n" ([ ] ++ optional (cfg.extraConfig != "") cfg.extraConfig ++ optionals (cfg.properties != null)