1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-11-08 19:46:05 +01:00
home-manager/tests/modules/programs/zed-editor/tasks-immutable.nix

44 lines
932 B
Nix

# Test custom keymap functionality
{ config, ... }:
{
programs.zed-editor = {
enable = true;
package = config.lib.test.mkStubPackage { };
mutableUserTasks = false;
userTasks = [
{
label = "Format Code";
command = "nix";
args = [
"fmt"
"$ZED_WORKTREE_ROOT"
];
allow_concurrent_runs = false;
}
];
};
nmt.script =
let
expectedContent = builtins.toFile "expected.json" ''
[
{
"allow_concurrent_runs": false,
"args": [
"fmt",
"$ZED_WORKTREE_ROOT"
],
"command": "nix",
"label": "Format Code"
}
]
'';
settingsPath = ".config/zed/tasks.json";
in
''
assertFileExists "home-files/${settingsPath}"
assertFileContent "home-files/${settingsPath}" "${expectedContent}"
'';
}