feat(c): init c template
This commit is contained in:
parent
8e52914770
commit
01bc222af3
7 changed files with 108 additions and 0 deletions
25
templates/c/flake/default.nix
Normal file
25
templates/c/flake/default.nix
Normal file
|
@ -0,0 +1,25 @@
|
|||
{
|
||||
stdenv,
|
||||
lib,
|
||||
meson,
|
||||
ninja,
|
||||
}:
|
||||
stdenv.mkDerivation {
|
||||
pname = "REPLACE_ME";
|
||||
version = "1";
|
||||
|
||||
src = lib.cleanSourceWith {
|
||||
src = ../.;
|
||||
filter = path: _type: baseNameOf path != ".git";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [
|
||||
meson
|
||||
ninja
|
||||
];
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/bin
|
||||
mv timesave $out/bin
|
||||
'';
|
||||
}
|
20
templates/c/flake/formatter.nix
Normal file
20
templates/c/flake/formatter.nix
Normal file
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
writeShellApplication,
|
||||
alejandra,
|
||||
llvmPackages_19,
|
||||
fd,
|
||||
}:
|
||||
writeShellApplication {
|
||||
name = "formatter";
|
||||
runtimeInputs = [
|
||||
alejandra
|
||||
llvmPackages_19.clang-tools
|
||||
fd
|
||||
];
|
||||
text = ''
|
||||
fd --extension nix -X alejandra -- {}
|
||||
fd --extension nix -X deadnix -e -- {}
|
||||
fd --extension nix -x statix fix -- {}
|
||||
fd --extension c -X clang-format --verbose -i -- {}
|
||||
'';
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue