pet: Add support for tags in snippets (#1883)
Add missing `tag` option for elements of `programs.pet.snippets`.
This commit is contained in:
parent
6aa6556bca
commit
1e7e8ac75d
|
@ -36,6 +36,15 @@ let
|
|||
Example output of the command.
|
||||
'';
|
||||
};
|
||||
|
||||
tag = mkOption {
|
||||
type = types.listOf types.str;
|
||||
default = [ ];
|
||||
example = literalExample ''["git" "nixpkgs"]'';
|
||||
description = ''
|
||||
List of tags attached to the command.
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
@ -66,6 +66,7 @@ import nmt {
|
|||
./modules/programs/neomutt
|
||||
./modules/programs/newsboat
|
||||
./modules/programs/nushell
|
||||
./modules/programs/pet
|
||||
./modules/programs/powerline-go
|
||||
./modules/programs/qutebrowser
|
||||
./modules/programs/readline
|
||||
|
|
1
tests/modules/programs/pet/default.nix
Normal file
1
tests/modules/programs/pet/default.nix
Normal file
|
@ -0,0 +1 @@
|
|||
{ pet-snippets = ./snippets.nix; }
|
5
tests/modules/programs/pet/snippet.toml
Normal file
5
tests/modules/programs/pet/snippet.toml
Normal file
|
@ -0,0 +1,5 @@
|
|||
[[snippets]]
|
||||
command = "git log -p -G <regex>"
|
||||
description = "git: search full history for regex"
|
||||
output = ""
|
||||
tag = ["git", "regex"]
|
29
tests/modules/programs/pet/snippets.nix
Normal file
29
tests/modules/programs/pet/snippets.nix
Normal file
|
@ -0,0 +1,29 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
{
|
||||
config = {
|
||||
programs.pet = {
|
||||
enable = true;
|
||||
selectcmdPackage = pkgs.writeScriptBin "pet-cmd" "" // {
|
||||
outPath = "@pet-cmd@";
|
||||
};
|
||||
snippets = [{
|
||||
description = "git: search full history for regex";
|
||||
command = "git log -p -G <regex>";
|
||||
tag = [ "git" "regex" ];
|
||||
}];
|
||||
};
|
||||
|
||||
nixpkgs.overlays = [
|
||||
(self: super: {
|
||||
pet = pkgs.writeScriptBin "pet" "" // { outPath = "@pet@"; };
|
||||
})
|
||||
];
|
||||
|
||||
nmt.script = ''
|
||||
assertFileContent home-files/.config/pet/snippet.toml ${./snippet.toml}
|
||||
'';
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue