jujutsu: switch to XDG config home
This commit is contained in:
parent
d939ce585c
commit
d768262018
|
@ -34,16 +34,14 @@ in {
|
||||||
settings = mkOption {
|
settings = mkOption {
|
||||||
type = tomlFormat.type;
|
type = tomlFormat.type;
|
||||||
default = { };
|
default = { };
|
||||||
example = literalExpression ''
|
example = {
|
||||||
{
|
user = {
|
||||||
user = {
|
name = "John Doe";
|
||||||
name = "John Doe";
|
email = "jdoe@example.org";
|
||||||
email = "jdoe@example.org";
|
};
|
||||||
};
|
};
|
||||||
}
|
|
||||||
'';
|
|
||||||
description = ''
|
description = ''
|
||||||
Options to add to the {file}`.jjconfig.toml` file. See
|
Options to add to the {file}`config.toml` file. See
|
||||||
<https://github.com/martinvonz/jj/blob/main/docs/config.md>
|
<https://github.com/martinvonz/jj/blob/main/docs/config.md>
|
||||||
for options.
|
for options.
|
||||||
'';
|
'';
|
||||||
|
@ -53,7 +51,7 @@ in {
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
home.packages = [ cfg.package ];
|
home.packages = [ cfg.package ];
|
||||||
|
|
||||||
home.file.".jjconfig.toml" = mkIf (cfg.settings != { }) {
|
xdg.configFile."jj/config.toml" = mkIf (cfg.settings != { }) {
|
||||||
source = tomlFormat.generate "jujutsu-config" (cfg.settings
|
source = tomlFormat.generate "jujutsu-config" (cfg.settings
|
||||||
// optionalAttrs (cfg.ediff) (let
|
// optionalAttrs (cfg.ediff) (let
|
||||||
emacsDiffScript = pkgs.writeShellScriptBin "emacs-ediff" ''
|
emacsDiffScript = pkgs.writeShellScriptBin "emacs-ediff" ''
|
||||||
|
|
|
@ -6,6 +6,6 @@
|
||||||
test.stubs.jujutsu = { };
|
test.stubs.jujutsu = { };
|
||||||
|
|
||||||
nmt.script = ''
|
nmt.script = ''
|
||||||
assertPathNotExists home-files/.jjconfig.toml
|
assertPathNotExists home-files/.config/jj/config.toml
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,9 +13,9 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
nmt.script = ''
|
nmt.script = ''
|
||||||
assertFileExists home-files/.jjconfig.toml
|
assertFileExists home-files/.config/jj/config.toml
|
||||||
assertFileContent \
|
assertFileContent \
|
||||||
home-files/.jjconfig.toml \
|
home-files/.config/jj/config.toml \
|
||||||
${
|
${
|
||||||
builtins.toFile "expected.toml" ''
|
builtins.toFile "expected.toml" ''
|
||||||
[user]
|
[user]
|
||||||
|
|
Loading…
Reference in a new issue