jujutsu: support darwin guidelines for config placement

Follow up to #5207, fixing jujutsu module on darwin targets.
This commit is contained in:
Milo Moisson 2024-07-28 22:54:29 +02:00 committed by GitHub
parent 9fdadb1cb6
commit ea72cf548f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 19 additions and 9 deletions

View file

@ -7,6 +7,11 @@ let
cfg = config.programs.jujutsu;
tomlFormat = pkgs.formats.toml { };
configDir = if pkgs.stdenv.isDarwin then
"Library/Application Support"
else
config.xdg.configHome;
in {
meta.maintainers = [ maintainers.shikanime ];
@ -51,7 +56,7 @@ in {
config = mkIf cfg.enable {
home.packages = [ cfg.package ];
xdg.configFile."jj/config.toml" = mkIf (cfg.settings != { }) {
home.file."${configDir}/jj/config.toml" = mkIf (cfg.settings != { }) {
source = tomlFormat.generate "jujutsu-config" (cfg.settings
// optionalAttrs (cfg.ediff) (let
emacsDiffScript = pkgs.writeShellScriptBin "emacs-ediff" ''