fork/home-manager
git clone https://git.julia.blue/fork/home-manager
7e81e7ae
master
1{ config , lib , pkgs , ...} : 2 3with lib ; 4 5let 6 7func = pkgs . writeText "func.fish" '' 8function func 9echo Hello 10end 11'' ; 12 13funcEvent = pkgs . writeText "func-event.fish" '' 14function func-event --on-event="fish_command_not_found" 15echo "Not found!" 16end 17'' ; 18 19in { 20config = { 21programs . fish = { 22enable = true ; 23 24functions = { 25func = ''echo "Hello"'' ; 26func-event = { 27body = ''echo "Not found!"'' ; 28onEvent = "fish_command_not_found" ; 29}; 30}; 31}; 32 33# Needed to avoid error with dummy fish package. 34xdg . dataFile . "fish/home-manager_generated_completions" . source = 35lib . mkForce ( builtins . toFile "empty" "" ); 36 37nmt = { 38description = 39"if fish.function is set, check file exists and contents match" ; 40script = '' 41assertFileExists home-files/.config/fish/functions/func.fish 42echo ${ func } 43assertFileContent home-files/.config/fish/functions/func.fish ${ func } 44 45assertFileExists home-files/.config/fish/functions/func-event.fish 46echo ${ funcEvent } 47assertFileContent home-files/.config/fish/functions/func-event.fish ${ funcEvent } 48'' ; 49 50}; 51}; 52}