mirror of
https://github.com/nix-community/home-manager
synced 2024-11-10 07:04:17 +00:00
jujutsu: switch to XDG config home
This commit is contained in:
parent
d939ce585c
commit
d768262018
3 changed files with 11 additions and 13 deletions
|
@ -34,16 +34,14 @@ in {
|
|||
settings = mkOption {
|
||||
type = tomlFormat.type;
|
||||
default = { };
|
||||
example = literalExpression ''
|
||||
{
|
||||
user = {
|
||||
name = "John Doe";
|
||||
email = "jdoe@example.org";
|
||||
};
|
||||
}
|
||||
'';
|
||||
example = {
|
||||
user = {
|
||||
name = "John Doe";
|
||||
email = "jdoe@example.org";
|
||||
};
|
||||
};
|
||||
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>
|
||||
for options.
|
||||
'';
|
||||
|
@ -53,7 +51,7 @@ in {
|
|||
config = mkIf cfg.enable {
|
||||
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
|
||||
// optionalAttrs (cfg.ediff) (let
|
||||
emacsDiffScript = pkgs.writeShellScriptBin "emacs-ediff" ''
|
||||
|
|
|
@ -6,6 +6,6 @@
|
|||
test.stubs.jujutsu = { };
|
||||
|
||||
nmt.script = ''
|
||||
assertPathNotExists home-files/.jjconfig.toml
|
||||
assertPathNotExists home-files/.config/jj/config.toml
|
||||
'';
|
||||
}
|
||||
|
|
|
@ -13,9 +13,9 @@
|
|||
};
|
||||
|
||||
nmt.script = ''
|
||||
assertFileExists home-files/.jjconfig.toml
|
||||
assertFileExists home-files/.config/jj/config.toml
|
||||
assertFileContent \
|
||||
home-files/.jjconfig.toml \
|
||||
home-files/.config/jj/config.toml \
|
||||
${
|
||||
builtins.toFile "expected.toml" ''
|
||||
[user]
|
||||
|
|
Loading…
Reference in a new issue