mirror of
https://github.com/nix-community/home-manager
synced 2024-11-16 08:09:45 +01:00
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.
32 lines
570 B
Nix
32 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}
|
|
'';
|
|
|
|
};
|
|
};
|
|
}
|