superfile: initial support (#6610)
Add initial support for `superfile` file manager.
This commit is contained in:
parent
273ad32fbb
commit
5a096a8822
12 changed files with 328 additions and 0 deletions
5
tests/modules/programs/superfile/default.nix
Normal file
5
tests/modules/programs/superfile/default.nix
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
superfile-example-settings = ./example-settings.nix;
|
||||
superfile-empty-settings = ./empty-settings.nix;
|
||||
superfile-partial-theme-settings = ./partial-theme-settings.nix;
|
||||
}
|
||||
16
tests/modules/programs/superfile/empty-settings.nix
Normal file
16
tests/modules/programs/superfile/empty-settings.nix
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
{ pkgs, lib, ... }:
|
||||
|
||||
{
|
||||
programs.superfile.enable = true;
|
||||
|
||||
xdg.enable = lib.mkIf pkgs.stdenv.isDarwin false;
|
||||
|
||||
nmt.script =
|
||||
let
|
||||
configDir =
|
||||
if !pkgs.stdenv.isDarwin then ".config/superfile" else "Library/Application Support/superfile";
|
||||
in
|
||||
''
|
||||
assertPathNotExists home-files/${configDir}
|
||||
'';
|
||||
}
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
default_sort_type = 0
|
||||
theme = "catppuccin-frappe"
|
||||
transparent_background = false
|
||||
|
|
@ -0,0 +1 @@
|
|||
confirm = ["enter", "right", "l"]
|
||||
86
tests/modules/programs/superfile/example-settings.nix
Normal file
86
tests/modules/programs/superfile/example-settings.nix
Normal file
|
|
@ -0,0 +1,86 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
xdg.enable = lib.mkIf pkgs.stdenv.isDarwin false;
|
||||
|
||||
programs.superfile = {
|
||||
enable = true;
|
||||
package = config.lib.test.mkStubPackage { };
|
||||
|
||||
settings = {
|
||||
theme = "catppuccin-frappe";
|
||||
default_sort_type = 0;
|
||||
transparent_background = false;
|
||||
};
|
||||
hotkeys = {
|
||||
confirm = [
|
||||
"enter"
|
||||
"right"
|
||||
"l"
|
||||
];
|
||||
};
|
||||
themes = {
|
||||
test0 = {
|
||||
code_syntax_highlight = "catppuccin-latte";
|
||||
|
||||
file_panel_border = "#101010";
|
||||
sidebar_border = "#101011";
|
||||
footer_border = "#101012";
|
||||
|
||||
gradient_color = [
|
||||
"#101013"
|
||||
"#101014"
|
||||
];
|
||||
};
|
||||
|
||||
test1 = ./example-theme-expected.toml;
|
||||
|
||||
test2 = {
|
||||
code_syntax_highlight = "catppuccin-frappe";
|
||||
|
||||
file_panel_border = "#202020";
|
||||
sidebar_border = "#202021";
|
||||
footer_border = "#202022";
|
||||
|
||||
gradient_color = [
|
||||
"#202023"
|
||||
"#202024"
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
nmt.script =
|
||||
let
|
||||
configSubPath =
|
||||
if !pkgs.stdenv.isDarwin then ".config/superfile" else "Library/Application Support/superfile";
|
||||
configBasePath = "home-files/" + configSubPath;
|
||||
in
|
||||
''
|
||||
assertFileExists "${configBasePath}/config.toml"
|
||||
assertFileContent \
|
||||
"${configBasePath}/config.toml" \
|
||||
${./example-config-expected.toml}
|
||||
assertFileExists "${configBasePath}/hotkeys.toml"
|
||||
assertFileContent \
|
||||
"${configBasePath}/hotkeys.toml" \
|
||||
${./example-hotkeys-expected.toml}
|
||||
assertFileExists "${configBasePath}/theme/test0.toml"
|
||||
assertFileContent \
|
||||
"${configBasePath}/theme/test0.toml" \
|
||||
${./example-theme-expected.toml}
|
||||
assertFileExists "${configBasePath}/theme/test1.toml"
|
||||
assertFileContent \
|
||||
"${configBasePath}/theme/test1.toml" \
|
||||
${./example-theme-expected.toml}
|
||||
assertFileExists "${configBasePath}/theme/test2.toml"
|
||||
assertFileContent \
|
||||
"${configBasePath}/theme/test2.toml" \
|
||||
${./example-theme2-expected.toml}
|
||||
'';
|
||||
}
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
code_syntax_highlight = "catppuccin-latte"
|
||||
file_panel_border = "#101010"
|
||||
footer_border = "#101012"
|
||||
gradient_color = ["#101013", "#101014"]
|
||||
sidebar_border = "#101011"
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
code_syntax_highlight = "catppuccin-frappe"
|
||||
file_panel_border = "#202020"
|
||||
footer_border = "#202022"
|
||||
gradient_color = ["#202023", "#202024"]
|
||||
sidebar_border = "#202021"
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
theme = "test0"
|
||||
transparent_background = false
|
||||
53
tests/modules/programs/superfile/partial-theme-settings.nix
Normal file
53
tests/modules/programs/superfile/partial-theme-settings.nix
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
# When not specified in `programs.superfile.settings.theme`,
|
||||
# test that the first skin name (alphabetically) is used in the config file
|
||||
{ pkgs, lib, ... }:
|
||||
{
|
||||
xdg.enable = lib.mkIf pkgs.stdenv.isDarwin false;
|
||||
|
||||
programs.superfile = {
|
||||
enable = true;
|
||||
settings = {
|
||||
transparent_background = false;
|
||||
};
|
||||
themes = {
|
||||
test2 = {
|
||||
code_syntax_highlight = "catppuccin-frappe";
|
||||
|
||||
file_panel_border = "#202020";
|
||||
sidebar_border = "#202021";
|
||||
footer_border = "#202022";
|
||||
|
||||
gradient_color = [
|
||||
"#202023"
|
||||
"#202024"
|
||||
];
|
||||
};
|
||||
|
||||
test0 = {
|
||||
code_syntax_highlight = "catppuccin-latte";
|
||||
|
||||
file_panel_border = "#101010";
|
||||
sidebar_border = "#101011";
|
||||
footer_border = "#101012";
|
||||
|
||||
gradient_color = [
|
||||
"#101013"
|
||||
"#101014"
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
nmt.script =
|
||||
let
|
||||
configSubPath =
|
||||
if !pkgs.stdenv.isDarwin then ".config/superfile" else "Library/Application Support/superfile";
|
||||
configBasePath = "home-files/" + configSubPath;
|
||||
in
|
||||
''
|
||||
assertFileExists "${configBasePath}/config.toml"
|
||||
assertFileContent \
|
||||
"${configBasePath}/config.toml" \
|
||||
${./partial-theme-settings-expected.toml}
|
||||
'';
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue