Add wireshark, cleanup on fish functions
This commit is contained in:
parent
e6643c0d1d
commit
b071f6c695
3 changed files with 19 additions and 17 deletions
|
@ -11,7 +11,7 @@ in
|
||||||
config = mkIf (cfg.enable) {
|
config = mkIf (cfg.enable) {
|
||||||
programs.fish = {
|
programs.fish = {
|
||||||
enable = true;
|
enable = true;
|
||||||
functions = (import ./functions.nix);
|
functions = (import ./functions.nix { inherit (pkgs) git; });
|
||||||
|
|
||||||
plugins = [
|
plugins = [
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
{ git }:
|
||||||
{
|
{
|
||||||
reload = {
|
reload = {
|
||||||
body = ''
|
body = ''
|
||||||
|
@ -18,25 +19,25 @@
|
||||||
};
|
};
|
||||||
clangfmt = {
|
clangfmt = {
|
||||||
body = ''
|
body = ''
|
||||||
set source_exts "h" "hpp" "c" "cpp" "cc" "cp" "c++" "cxx" "cu" "proto"
|
set source_exts "h" "hpp" "c" "cpp" "cc" "cp" "c++" "cxx" "cu" "proto"
|
||||||
set files (git diff --diff-filter=ACMR --name-only $argv[1])
|
set files (${git}/bin/git diff --diff-filter=ACMR --name-only $argv[1])
|
||||||
set repo_path (realpath --relative-to=$PWD (git rev-parse --show-toplevel))
|
set repo_path (realpath --relative-to=$PWD (${git}/bin/git rev-parse --show-toplevel))
|
||||||
set clangformat (git config --get clangFormat.binary)
|
set clangformat (${git}/bin/git config --get clangFormat.binary)
|
||||||
echo "Formatting files in $repo_path with $clangformat"
|
echo "Formatting files in $repo_path with $clangformat"
|
||||||
|
|
||||||
for f in $files
|
for f in $files
|
||||||
set file (realpath $repo_path/$f)
|
set file (realpath $repo_path/$f)
|
||||||
echo "Processing $file"
|
echo "Processing $file"
|
||||||
|
|
||||||
set ext (string match -r ".*\.([^\.]+)\$" $file)[2]
|
set ext (string match -r ".*\.([^\.]+)\$" $file)[2]
|
||||||
|
|
||||||
if contains $ext $source_exts
|
if contains $ext $source_exts
|
||||||
echo "Formatting $file"
|
echo "Formatting $file"
|
||||||
$clangformat -i -style=file $file
|
$clangformat -i -style=file $file
|
||||||
else
|
else
|
||||||
echo "Extension $ext not found in $source_exts"
|
echo "Extension $ext not found in $source_exts"
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
end
|
||||||
'';
|
'';
|
||||||
description = "Use clang-format to format all changed and added files";
|
description = "Use clang-format to format all changed and added files";
|
||||||
};
|
};
|
||||||
|
|
|
@ -107,6 +107,7 @@ in
|
||||||
tdesktop
|
tdesktop
|
||||||
unzip
|
unzip
|
||||||
xdg-utils
|
xdg-utils
|
||||||
|
wireshark
|
||||||
wl-clipboard
|
wl-clipboard
|
||||||
] ++
|
] ++
|
||||||
(with gst_all_1; [ gstreamer gstreamer.dev gst-plugins-base gst-plugins-good gst-plugins-bad gst-plugins-ugly gst-libav gst-vaapi ]);
|
(with gst_all_1; [ gstreamer gstreamer.dev gst-plugins-base gst-plugins-good gst-plugins-bad gst-plugins-ugly gst-libav gst-vaapi ]);
|
||||||
|
|
Loading…
Reference in a new issue