chore: reformat all files with nixfmt-rfc-style

This commit is contained in:
Harsh Shandilya 2024-12-16 18:33:26 +05:30
parent 7fd491b0da
commit b52dea88b0
3 changed files with 100 additions and 80 deletions

View file

@ -1,8 +1,9 @@
(import (let
(import (
let
lock = builtins.fromJSON (builtins.readFile ./flake.lock);
in
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

View file

@ -22,7 +22,8 @@
inputs.flake-compat.url = "github:nix-community/flake-compat";
inputs.flake-compat.flake = false;
outputs = {
outputs =
{
self,
nixpkgs,
advisory-db,
@ -32,13 +33,15 @@
flake-utils,
...
}:
flake-utils.lib.eachDefaultSystem (system: let
flake-utils.lib.eachDefaultSystem (
system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [devshell.overlays.default];
overlays = [ devshell.overlays.default ];
};
rustStable = (import fenix {inherit pkgs;}).fromToolchainFile {
rustStable = (import fenix { inherit pkgs; }).fromToolchainFile {
file = ./rust-toolchain.toml;
sha256 = "sha256-yMuSb5eQPO/bHv+Bcf/US8LVMbf/G/0MSfiPwBhiPpk=";
};
@ -46,36 +49,50 @@
craneLib = (crane.mkLib pkgs).overrideToolchain rustStable;
commonArgs = {
src = craneLib.cleanCargoSource ./.;
buildInputs = [];
nativeBuildInputs = with pkgs;
[xorg.libxcb python312]
++ pkgs.lib.optionals stdenv.isDarwin
[pkgs.darwin.apple_sdk.frameworks.AppKit];
buildInputs = [ ];
nativeBuildInputs =
with pkgs;
[
xorg.libxcb
python312
]
++ pkgs.lib.optionals stdenv.isDarwin [ pkgs.darwin.apple_sdk.frameworks.AppKit ];
cargoClippyExtraArgs = "--all-targets -- --deny warnings";
};
cargoArtifacts = craneLib.buildDepsOnly (commonArgs // {doCheck = false;});
cargoArtifacts = craneLib.buildDepsOnly (commonArgs // { doCheck = false; });
clipboard-substitutor = craneLib.buildPackage (commonArgs // {doCheck = false;});
clipboard-substitutor-clippy = craneLib.cargoClippy (commonArgs
clipboard-substitutor = craneLib.buildPackage (commonArgs // { doCheck = false; });
clipboard-substitutor-clippy = craneLib.cargoClippy (
commonArgs
// {
inherit cargoArtifacts;
});
clipboard-substitutor-fmt = craneLib.cargoFmt (commonArgs // {});
clipboard-substitutor-audit = craneLib.cargoAudit (commonArgs // {inherit advisory-db;});
clipboard-substitutor-nextest = craneLib.cargoNextest (commonArgs
}
);
clipboard-substitutor-fmt = craneLib.cargoFmt (commonArgs // { });
clipboard-substitutor-audit = craneLib.cargoAudit (commonArgs // { inherit advisory-db; });
clipboard-substitutor-nextest = craneLib.cargoNextest (
commonArgs
// {
inherit cargoArtifacts;
partitions = 1;
partitionType = "count";
});
in {
}
);
in
{
checks = {
inherit clipboard-substitutor clipboard-substitutor-audit clipboard-substitutor-clippy clipboard-substitutor-fmt clipboard-substitutor-nextest;
inherit
clipboard-substitutor
clipboard-substitutor-audit
clipboard-substitutor-clippy
clipboard-substitutor-fmt
clipboard-substitutor-nextest
;
};
packages.default = clipboard-substitutor;
apps.default = flake-utils.lib.mkApp {drv = clipboard-substitutor;};
apps.default = flake-utils.lib.mkApp { drv = clipboard-substitutor; };
devShells.default = pkgs.devshell.mkShell {
imports = [
@ -100,5 +117,6 @@
language.c.libraries = commonArgs.nativeBuildInputs;
language.rust.enableDefaultToolchain = false;
};
});
}
);
}

View file

@ -1,8 +1,9 @@
(import (let
(import (
let
lock = builtins.fromJSON (builtins.readFile ./flake.lock);
in
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