feat: Change nix formatter to alejandra
This commit is contained in:
parent
0b8b647f05
commit
b4c3dfec42
229 changed files with 2528 additions and 2884 deletions
|
|
@ -5,20 +5,17 @@
|
|||
url = "github:numtide/flake-utils";
|
||||
};
|
||||
};
|
||||
outputs =
|
||||
{
|
||||
flake-utils,
|
||||
nixpkgs,
|
||||
...
|
||||
}:
|
||||
outputs = {
|
||||
flake-utils,
|
||||
nixpkgs,
|
||||
...
|
||||
}:
|
||||
flake-utils.lib.eachDefaultSystem (
|
||||
system:
|
||||
let
|
||||
system: let
|
||||
pkgs = import nixpkgs {
|
||||
localSystem = { inherit system; };
|
||||
localSystem = {inherit system;};
|
||||
};
|
||||
in
|
||||
{
|
||||
in {
|
||||
formatter = pkgs.alejandra;
|
||||
devShells.default = pkgs.mkShell {
|
||||
packages = with pkgs; [
|
||||
|
|
|
|||
|
|
@ -5,26 +5,23 @@
|
|||
url = "github:numtide/flake-utils";
|
||||
};
|
||||
};
|
||||
outputs =
|
||||
{
|
||||
flake-utils,
|
||||
nixpkgs,
|
||||
...
|
||||
}:
|
||||
outputs = {
|
||||
flake-utils,
|
||||
nixpkgs,
|
||||
...
|
||||
}:
|
||||
flake-utils.lib.eachDefaultSystem (
|
||||
system:
|
||||
let
|
||||
system: let
|
||||
inherit (pkgs) lib;
|
||||
pkgs = import nixpkgs {
|
||||
localSystem = { inherit system; };
|
||||
localSystem = {inherit system;};
|
||||
config = {
|
||||
cudaSupport = true;
|
||||
allowUnfree = true;
|
||||
};
|
||||
};
|
||||
defaultPython = pkgs.python3;
|
||||
in
|
||||
{
|
||||
in {
|
||||
formatter = pkgs.alejandra;
|
||||
devShells.default = pkgs.mkShell {
|
||||
packages =
|
||||
|
|
|
|||
|
|
@ -24,23 +24,21 @@
|
|||
};
|
||||
};
|
||||
};
|
||||
outputs =
|
||||
{
|
||||
self,
|
||||
flake-utils,
|
||||
nixpkgs,
|
||||
rust-overlay,
|
||||
advisory-db,
|
||||
crane,
|
||||
pre-commit-hooks,
|
||||
...
|
||||
}:
|
||||
outputs = {
|
||||
self,
|
||||
flake-utils,
|
||||
nixpkgs,
|
||||
rust-overlay,
|
||||
advisory-db,
|
||||
crane,
|
||||
pre-commit-hooks,
|
||||
...
|
||||
}:
|
||||
flake-utils.lib.eachDefaultSystem (
|
||||
system:
|
||||
let
|
||||
system: let
|
||||
inherit (pkgs) lib;
|
||||
pkgs = import nixpkgs {
|
||||
localSystem = { inherit system; };
|
||||
localSystem = {inherit system;};
|
||||
overlays = [
|
||||
(import rust-overlay)
|
||||
(_final: prev: {
|
||||
|
|
@ -50,8 +48,7 @@
|
|||
};
|
||||
rustToolchain = pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml;
|
||||
craneLib = (crane.mkLib pkgs).overrideToolchain rustToolchain;
|
||||
srcFilters =
|
||||
path: type:
|
||||
srcFilters = path: type:
|
||||
builtins.any (lib.flip lib.hasSuffix path) [
|
||||
".sql"
|
||||
".diff"
|
||||
|
|
@ -68,16 +65,17 @@
|
|||
inherit src;
|
||||
strictDeps = true;
|
||||
};
|
||||
nativeBuildInputs = [ ];
|
||||
buildInputs = [ ];
|
||||
nativeBuildInputs = [];
|
||||
buildInputs = [];
|
||||
genInputs = lib.genInputsWith pkgs;
|
||||
commonArgs = basicArgs // {
|
||||
cargoArtifacts = self.packages.${system}.cargo-artifacts;
|
||||
buildInputs = genInputs buildInputs;
|
||||
nativeBuildInputs = genInputs nativeBuildInputs;
|
||||
};
|
||||
in
|
||||
{
|
||||
commonArgs =
|
||||
basicArgs
|
||||
// {
|
||||
cargoArtifacts = self.packages.${system}.cargo-artifacts;
|
||||
buildInputs = genInputs buildInputs;
|
||||
nativeBuildInputs = genInputs nativeBuildInputs;
|
||||
};
|
||||
in {
|
||||
formatter = pkgs.alejandra;
|
||||
checks = {
|
||||
pre-commit-check = pre-commit-hooks.lib.${system}.run {
|
||||
|
|
@ -89,11 +87,11 @@
|
|||
rustfmt.enable = true;
|
||||
cargo-check = {
|
||||
enable = true;
|
||||
stages = [ "pre-push" ];
|
||||
stages = ["pre-push"];
|
||||
};
|
||||
clippy = {
|
||||
enable = true;
|
||||
stages = [ "pre-push" ];
|
||||
stages = ["pre-push"];
|
||||
settings.denyWarnings = true;
|
||||
};
|
||||
};
|
||||
|
|
@ -125,26 +123,24 @@
|
|||
}
|
||||
);
|
||||
};
|
||||
packages =
|
||||
let
|
||||
callPackage = lib.callPackageWith (pkgs // { inherit craneLib callPackage; });
|
||||
packageArgs = {
|
||||
inherit
|
||||
lib
|
||||
basicArgs
|
||||
buildInputs
|
||||
nativeBuildInputs
|
||||
;
|
||||
};
|
||||
importWithArgs = with lib; flip import packageArgs;
|
||||
in
|
||||
rec {
|
||||
cargo-artifacts = callPackage (importWithArgs ./nix/cargo-artifacts.nix) { };
|
||||
rust-demo = callPackage (importWithArgs ./nix/package.nix) {
|
||||
cargoArtifacts = cargo-artifacts;
|
||||
};
|
||||
default = rust-demo;
|
||||
packages = let
|
||||
callPackage = lib.callPackageWith (pkgs // {inherit craneLib callPackage;});
|
||||
packageArgs = {
|
||||
inherit
|
||||
lib
|
||||
basicArgs
|
||||
buildInputs
|
||||
nativeBuildInputs
|
||||
;
|
||||
};
|
||||
importWithArgs = with lib; flip import packageArgs;
|
||||
in rec {
|
||||
cargo-artifacts = callPackage (importWithArgs ./nix/cargo-artifacts.nix) {};
|
||||
rust-demo = callPackage (importWithArgs ./nix/package.nix) {
|
||||
cargoArtifacts = cargo-artifacts;
|
||||
};
|
||||
default = rust-demo;
|
||||
};
|
||||
apps.default = flake-utils.lib.mkApp {
|
||||
drv = self.packages."${system}".default;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -3,17 +3,14 @@
|
|||
basicArgs,
|
||||
buildInputs,
|
||||
nativeBuildInputs,
|
||||
}:
|
||||
let
|
||||
f =
|
||||
{
|
||||
craneLib,
|
||||
lib,
|
||||
...
|
||||
}@args:
|
||||
let
|
||||
genInputs = lib.genInputsWith args;
|
||||
in
|
||||
}: let
|
||||
f = {
|
||||
craneLib,
|
||||
lib,
|
||||
...
|
||||
} @ args: let
|
||||
genInputs = lib.genInputsWith args;
|
||||
in
|
||||
craneLib.buildDepsOnly (
|
||||
basicArgs
|
||||
// {
|
||||
|
|
@ -22,5 +19,5 @@ let
|
|||
}
|
||||
);
|
||||
in
|
||||
with lib;
|
||||
setFunctionArgs f ((functionArgs f) // (genFunctionArgs (buildInputs ++ nativeBuildInputs)))
|
||||
with lib;
|
||||
setFunctionArgs f ((functionArgs f) // (genFunctionArgs (buildInputs ++ nativeBuildInputs)))
|
||||
|
|
|
|||
|
|
@ -7,8 +7,7 @@
|
|||
nameValuePair,
|
||||
getAttrFromPath,
|
||||
...
|
||||
}:
|
||||
{
|
||||
}: {
|
||||
genFunctionArgs = flip pipe [
|
||||
(map (
|
||||
flip pipe [
|
||||
|
|
@ -19,8 +18,7 @@
|
|||
))
|
||||
listToAttrs
|
||||
];
|
||||
genInputsWith =
|
||||
pkgs:
|
||||
genInputsWith = pkgs:
|
||||
map (
|
||||
flip pipe [
|
||||
(splitString ".")
|
||||
|
|
|
|||
|
|
@ -3,18 +3,15 @@
|
|||
basicArgs,
|
||||
buildInputs,
|
||||
nativeBuildInputs,
|
||||
}:
|
||||
let
|
||||
f =
|
||||
{
|
||||
craneLib,
|
||||
lib,
|
||||
cargoArtifacts,
|
||||
...
|
||||
}@args:
|
||||
let
|
||||
genInputs = lib.genInputsWith args;
|
||||
in
|
||||
}: let
|
||||
f = {
|
||||
craneLib,
|
||||
lib,
|
||||
cargoArtifacts,
|
||||
...
|
||||
} @ args: let
|
||||
genInputs = lib.genInputsWith args;
|
||||
in
|
||||
craneLib.buildPackage (
|
||||
basicArgs
|
||||
// {
|
||||
|
|
@ -32,5 +29,5 @@ let
|
|||
}
|
||||
);
|
||||
in
|
||||
with lib;
|
||||
setFunctionArgs f ((functionArgs f) // (genFunctionArgs (buildInputs ++ nativeBuildInputs)))
|
||||
with lib;
|
||||
setFunctionArgs f ((functionArgs f) // (genFunctionArgs (buildInputs ++ nativeBuildInputs)))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue