111011b2c2
- If a function is defined, check that the function file exists and that the contents matches a given string. - If no functions exists, the functions folder should not exist. - Verify plugin functionality.
33 lines
570 B
Nix
33 lines
570 B
Nix
{ config, lib, pkgs, ... }:
|
|
|
|
with lib;
|
|
|
|
let
|
|
|
|
func = pkgs.writeText "func.fish" ''
|
|
function func
|
|
echo "Hello"
|
|
end
|
|
'';
|
|
|
|
in {
|
|
config = {
|
|
programs.fish = {
|
|
enable = true;
|
|
|
|
functions = { func = ''echo "Hello"''; };
|
|
};
|
|
|
|
nmt = {
|
|
description =
|
|
"if fish.function is set, check file exists and contents match";
|
|
script = ''
|
|
assertFileExists home-files/.config/fish/functions/func.fish
|
|
echo ${func}
|
|
assertFileContent home-files/.config/fish/functions/func.fish ${func}
|
|
'';
|
|
|
|
};
|
|
};
|
|
}
|