feat(fmt): Add formatter using alejandra and format flake

This commit is contained in:
Jiří Štefka 2024-10-24 00:33:12 +02:00
parent c3bcb27b19
commit f0c3c00b56
Signed by: jiriks74
GPG Key ID: 1D5E30D3DB2264DE
2 changed files with 17 additions and 12 deletions

@ -38,6 +38,10 @@
# This is where the Neovim derivation is built.
neovim-overlay = import ./nix/neovim-overlay.nix {inherit inputs;};
inherit (self) outputs;
# This is a function that generates an attribute by calling a function you
# pass to it, with each system as an argument
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
in
flake-utils.lib.eachSystem supportedSystems (system: let
pkgs = import nixpkgs {
@ -66,6 +70,7 @@
'';
};
in {
formatter = nixpkgs.legacyPackages.${system}.alejandra;
packages = rec {
default = nvim;
nvim = pkgs.nvim-pkg;

@ -1,13 +1,14 @@
{ stdenv, lib
, system ? builtins.currentSystem
, fetchurl
, unzip
, libz
, libcxx
, lttng-ust_2_12
, autoPatchelfHook
{
stdenv,
lib,
system ? builtins.currentSystem,
fetchurl,
unzip,
libz,
libcxx,
lttng-ust_2_12,
autoPatchelfHook,
}:
stdenv.mkDerivation rec {
pname = "cpptools";
version = "1.21.6";
@ -20,7 +21,6 @@ stdenv.mkDerivation rec {
darwin-x64 = "https://github.com/microsoft/vscode-cpptools/releases/download/v${version}/cpptools-macos-x64.vsix";
darwin-arm64 = "https://github.com/microsoft/vscode-cpptools/releases/download/v${version}/cpptools-macos-arm64.vsix";
src = fetchurl {
url = lib.getAttr system {
x86_64-linux = "https://github.com/microsoft/vscode-cpptools/releases/download/v${version}/cpptools-linux-x64.vsix";
@ -34,7 +34,7 @@ stdenv.mkDerivation rec {
x86_64-darwin = "sha256-P2LacAaCRXnsGUQOLuIyvfgxweeVHsDFTrAEuN/lBIQ=";
aarch64-darwin = "sha256-P2LacAaCRXnsGUQOLuIyvfgxweeVHsDFTrAEuN/lBIQ=";
};
};
};
nativeBuildInputs = [
autoPatchelfHook