chore: reformat all files with nixfmt-rfc-style

This commit is contained in:
Harsh Shandilya 2024-12-16 18:33:28 +05:30
parent bd500e2a08
commit a7b12817bf
3 changed files with 103 additions and 82 deletions

View file

@ -1,8 +1,9 @@
(import (let
lock = builtins.fromJSON (builtins.readFile ./flake.lock);
in
(import (
let
lock = builtins.fromJSON (builtins.readFile ./flake.lock);
in
fetchTarball {
url = "https://github.com/nix-community/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz";
sha256 = lock.nodes.flake-compat.locked.narHash;
}) {src = ./.;})
.defaultNix
}
) { src = ./.; }).defaultNix

163
flake.nix
View file

@ -22,77 +22,96 @@
inputs.flake-compat.url = "github:nix-community/flake-compat";
inputs.flake-compat.flake = false;
outputs = {
nixpkgs,
advisory-db,
crane,
devshell,
fenix,
flake-utils,
...
}:
flake-utils.lib.eachDefaultSystem (system: let
pkgs = import nixpkgs {
inherit system;
overlays = [devshell.overlays.default];
};
rustNightly = (import fenix {inherit pkgs;}).fromToolchainFile {
file = ./rust-toolchain.toml;
sha256 = "sha256-XPGNBesOSwZJCXgynlavqa5QdsTAnodTmbx6t6XUWsY=";
};
craneLib = (crane.mkLib pkgs).overrideToolchain rustNightly;
src = craneLib.cleanCargoSource ./.;
nativeBuildInputs = [];
buildInputs = [];
cargoArtifacts = craneLib.buildDepsOnly {
inherit src buildInputs nativeBuildInputs;
};
commonArgs = {
inherit src cargoArtifacts buildInputs nativeBuildInputs;
cargoClippyExtraArgs = "--all-targets -- --deny warnings";
};
gitice = craneLib.buildPackage (commonArgs // {doCheck = false;});
gitice-clippy = craneLib.cargoClippy (commonArgs // {});
gitice-fmt = craneLib.cargoFmt (commonArgs // {});
gitice-audit =
craneLib.cargoAudit (commonArgs // {inherit advisory-db;});
gitice-nextest = craneLib.cargoNextest (commonArgs
// {
partitions = 1;
partitionType = "count";
});
in {
checks = {
inherit gitice gitice-audit gitice-clippy gitice-fmt gitice-nextest;
};
packages.default = gitice;
apps.default = flake-utils.lib.mkApp {drv = gitice;};
devShells.default = pkgs.devshell.mkShell {
bash = {interactive = "";};
env = [
{
name = "DEVSHELL_NO_MOTD";
value = 1;
outputs =
{
nixpkgs,
advisory-db,
crane,
devshell,
fenix,
flake-utils,
...
}:
flake-utils.lib.eachDefaultSystem (
system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [ devshell.overlays.default ];
};
rustNightly = (import fenix { inherit pkgs; }).fromToolchainFile {
file = ./rust-toolchain.toml;
sha256 = "sha256-XPGNBesOSwZJCXgynlavqa5QdsTAnodTmbx6t6XUWsY=";
};
craneLib = (crane.mkLib pkgs).overrideToolchain rustNightly;
src = craneLib.cleanCargoSource ./.;
nativeBuildInputs = [ ];
buildInputs = [ ];
cargoArtifacts = craneLib.buildDepsOnly {
inherit src buildInputs nativeBuildInputs;
};
commonArgs = {
inherit
src
cargoArtifacts
buildInputs
nativeBuildInputs
;
cargoClippyExtraArgs = "--all-targets -- --deny warnings";
};
gitice = craneLib.buildPackage (commonArgs // { doCheck = false; });
gitice-clippy = craneLib.cargoClippy (commonArgs // { });
gitice-fmt = craneLib.cargoFmt (commonArgs // { });
gitice-audit = craneLib.cargoAudit (commonArgs // { inherit advisory-db; });
gitice-nextest = craneLib.cargoNextest (
commonArgs
// {
partitions = 1;
partitionType = "count";
}
];
packages = with pkgs; [
cargo-dist
cargo-nextest
cargo-release
fenix.packages.${system}.rust-analyzer
git-cliff
rustNightly
stdenv.cc
];
};
});
);
in
{
checks = {
inherit
gitice
gitice-audit
gitice-clippy
gitice-fmt
gitice-nextest
;
};
packages.default = gitice;
apps.default = flake-utils.lib.mkApp { drv = gitice; };
devShells.default = pkgs.devshell.mkShell {
bash = {
interactive = "";
};
env = [
{
name = "DEVSHELL_NO_MOTD";
value = 1;
}
];
packages = with pkgs; [
cargo-dist
cargo-nextest
cargo-release
fenix.packages.${system}.rust-analyzer
git-cliff
rustNightly
stdenv.cc
];
};
}
);
}

View file

@ -1,8 +1,9 @@
(import (let
lock = builtins.fromJSON (builtins.readFile ./flake.lock);
in
(import (
let
lock = builtins.fromJSON (builtins.readFile ./flake.lock);
in
fetchTarball {
url = "https://github.com/nix-community/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz";
sha256 = lock.nodes.flake-compat.locked.narHash;
}) {src = ./.;})
.shellNix
}
) { src = ./.; }).shellNix