jjui: init module
Add a module for configuring the jjui program.
This commit is contained in:
parent
9eab59f3e7
commit
69083b3cdd
7 changed files with 150 additions and 0 deletions
5
tests/modules/programs/jjui/default.nix
Normal file
5
tests/modules/programs/jjui/default.nix
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
jjui-empty-settings = ./empty-settings.nix;
|
||||
jjui-example-settings = ./example-settings.nix;
|
||||
jjui-null-package = ./null-package.nix;
|
||||
}
|
||||
9
tests/modules/programs/jjui/empty-settings.nix
Normal file
9
tests/modules/programs/jjui/empty-settings.nix
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
config = {
|
||||
programs.jjui.enable = true;
|
||||
|
||||
nmt.script = ''
|
||||
assertPathNotExists home-files/.config/jjui
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
[revisions]
|
||||
revset = "ancestors(@ | heads(remote_branches())) ~ empty()"
|
||||
template = "builtin_log_compact"
|
||||
29
tests/modules/programs/jjui/example-settings.nix
Normal file
29
tests/modules/programs/jjui/example-settings.nix
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
config = {
|
||||
programs.jjui = {
|
||||
enable = true;
|
||||
settings = {
|
||||
revisions = {
|
||||
template = "builtin_log_compact";
|
||||
revset = "ancestors(@ | heads(remote_branches())) ~ empty()";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
nmt.script =
|
||||
let
|
||||
configDir = if !pkgs.stdenv.isDarwin then ".config/jjui" else "Library/Application Support/jjui";
|
||||
in
|
||||
''
|
||||
assertFileContent \
|
||||
"home-files/${configDir}/config.toml" \
|
||||
${./example-settings-expected.toml}
|
||||
'';
|
||||
};
|
||||
}
|
||||
30
tests/modules/programs/jjui/null-package.nix
Normal file
30
tests/modules/programs/jjui/null-package.nix
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
config = {
|
||||
programs.jjui = {
|
||||
enable = true;
|
||||
package = null;
|
||||
settings = {
|
||||
revisions.template = "builtin_log_oneline";
|
||||
};
|
||||
};
|
||||
|
||||
nmt.script =
|
||||
let
|
||||
configDir = if !pkgs.stdenv.isDarwin then ".config/jjui" else "Library/Application Support/jjui";
|
||||
in
|
||||
''
|
||||
assertFileContent \
|
||||
"home-files/${configDir}/config.toml" \
|
||||
${pkgs.writeText "expected" ''
|
||||
[revisions]
|
||||
template = "builtin_log_oneline"
|
||||
''}
|
||||
'';
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue