1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-03-31 04:04:32 +00:00
home-manager/tests/modules/programs/zed-editor/themes.nix
Muhammad Saghir 5738fa02ec zed-editor: add userThemes option
Adding support for custom local themes
2025-02-25 12:20:27 -05:00

71 lines
1.9 KiB
Nix

# Test custom theme functionality
{ config, ... }: {
programs.zed-editor = {
enable = true;
package = config.lib.test.mkStubPackage { };
userThemes = [{
name = "Test";
author = "user";
themes = [{
name = "Test Catppuccin";
appearance = "light";
style = {
editor = {
foreground = "#4c4f69";
background = "#eff1f5";
gutter.background = "#eff1f5";
subheader.background = "#e6e9ef";
active_line.background = "#4c4f690d";
highlighted_line.background = null;
line_number = "#8c8fa1";
active_line_number = "#8839ef";
invisible = "#7c7f9366";
wrap_guide = "#acb0be";
};
};
}];
}];
};
nmt.script = let
expectedContent = builtins.toFile "expected.json" ''
{
"author": "user",
"name": "test",
"themes": [
{
"appearance": "light",
"name": "Test Catppuccin",
"style": {
"editor": {
"active_line": {
"background": "#4c4f690d"
},
"active_line_number": "#8839ef",
"background": "#eff1f5",
"foreground": "#4c4f69",
"gutter": {
"background": "#eff1f5"
},
"highlighted_line": {
"background": null
},
"invisible": "#7c7f9366",
"line_number": "#8c8fa1",
"subheader": {
"background": "#e6e9ef"
},
"wrap_guide": "#acb0be"
}
}
}
]
}
'';
testPath = ".config/zed/themes/test.json";
in ''
assertFileExists "home-files/${testPath}"
assertFileContent "home-files/${testPath}" "${expectedContent}"
'';
}