Made with
```shell
git restore .
fd '\.nix$' pkgs/ --type f -j1 -x bash -xc "$(cat <<"EOF"
typos --no-check-filenames --write-changes "$1"
git diff --exit-code "$1" && exit
#( git diff "$1" | grep -qE "^\+ +[^# ]") && git restore "$1"
count1="$( bat --language nix --diff --style changes "$1" --theme "Monokai Extended" --color always | aha --no-header | grep -E '^<span style="color:olive;">~</span> ' | wc -l )"
count2="$( bat --language nix --diff --style changes "$1" --theme "Monokai Extended" --color always | aha --no-header | grep -E '^<span style="color:olive;">~</span> (<span style="color:#f8f8f2;"> *</span>)?<span style="color:#75715e;">.*</span>$' | wc -l )"
[[ $count1 -ne $count2 ]] && git restore "$1"
EOF
)" -- {}
```
and filtered with `GIT_DIFF_OPTS='--unified=15' git -c interactive.singleKey=true add --patch`
I initially tried using the tree-sitter cli, python bindings and even ast-grep through various means, but this is what I ended up with.
39 lines
1007 B
Nix
39 lines
1007 B
Nix
{
|
|
lib,
|
|
unwrapped,
|
|
}:
|
|
|
|
mkDerivation:
|
|
|
|
args:
|
|
|
|
# Check if it's supposed to not get built for the current gnuradio version
|
|
if (builtins.hasAttr "disabled" args) && args.disabled then
|
|
let
|
|
name = args.name or "${args.pname}";
|
|
in
|
|
throw "Package ${name} is incompatible with GNURadio ${unwrapped.versionAttr.major}"
|
|
else
|
|
|
|
if builtins.hasAttr "disabledForGRafter" args then
|
|
throw ''
|
|
`disabledForGRafter` is superseded by `disabled`.
|
|
Use `disabled = gnuradioAtLeast "${args.disabledForGRafter}";` instead.
|
|
''
|
|
else
|
|
|
|
let
|
|
args_ = {
|
|
enableParallelBuilding = args.enableParallelBuilding or true;
|
|
nativeBuildInputs = (args.nativeBuildInputs or [ ]);
|
|
# We add gnuradio and volk itself by default - most gnuradio based packages
|
|
# will not consider it a dependency worth mentioning and it will almost
|
|
# always be needed
|
|
buildInputs = (args.buildInputs or [ ]) ++ [
|
|
unwrapped
|
|
unwrapped.volk
|
|
];
|
|
};
|
|
in
|
|
mkDerivation (args // args_)
|