chore: reformat Nix files with `alejandra`

This commit is contained in:
Harsh Shandilya 2023-02-22 18:25:01 +00:00
parent cf3dc9a151
commit 60e3bf4798
3 changed files with 68 additions and 58 deletions

View File

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

View File

@ -2,9 +2,9 @@
description = "adnix";
inputs = {
nixpkgs = { url = "github:NixOS/nixpkgs/nixpkgs-unstable"; };
nixpkgs = {url = "github:NixOS/nixpkgs/nixpkgs-unstable";};
flake-utils = { url = "github:numtide/flake-utils"; };
flake-utils = {url = "github:numtide/flake-utils";};
flake-compat = {
url = "github:edolstra/flake-compat";
@ -35,54 +35,60 @@
};
};
outputs =
{ self, nixpkgs, crane, flake-utils, advisory-db, rust-overlay, ... }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [ (import rust-overlay) ];
};
outputs = {
self,
nixpkgs,
crane,
flake-utils,
advisory-db,
rust-overlay,
...
}:
flake-utils.lib.eachDefaultSystem (system: let
pkgs = import nixpkgs {
inherit system;
overlays = [(import rust-overlay)];
};
rustStable =
pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml;
craneLib = (crane.mkLib pkgs).overrideToolchain rustStable;
src = ./.;
cargoArtifacts = craneLib.buildDepsOnly { inherit src buildInputs; };
buildInputs = [ ];
rustStable =
pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml;
craneLib = (crane.mkLib pkgs).overrideToolchain rustStable;
src = ./.;
cargoArtifacts = craneLib.buildDepsOnly {inherit src buildInputs;};
buildInputs = [];
adnix = craneLib.buildPackage {
inherit src;
doCheck = false;
};
adnix-clippy = craneLib.cargoClippy {
inherit cargoArtifacts src buildInputs;
cargoClippyExtraArgs = "--all-targets -- --deny warnings";
};
adnix-fmt = craneLib.cargoFmt { inherit src; };
adnix-audit = craneLib.cargoAudit { inherit src advisory-db; };
adnix-nextest = craneLib.cargoNextest {
inherit cargoArtifacts src buildInputs;
partitions = 1;
partitionType = "count";
};
in {
checks = {
inherit adnix adnix-audit adnix-clippy adnix-fmt adnix-nextest;
};
adnix = craneLib.buildPackage {
inherit src;
doCheck = false;
};
adnix-clippy = craneLib.cargoClippy {
inherit cargoArtifacts src buildInputs;
cargoClippyExtraArgs = "--all-targets -- --deny warnings";
};
adnix-fmt = craneLib.cargoFmt {inherit src;};
adnix-audit = craneLib.cargoAudit {inherit src advisory-db;};
adnix-nextest = craneLib.cargoNextest {
inherit cargoArtifacts src buildInputs;
partitions = 1;
partitionType = "count";
};
in {
checks = {
inherit adnix adnix-audit adnix-clippy adnix-fmt adnix-nextest;
};
packages.default = adnix;
packages.default = adnix;
apps.default = flake-utils.lib.mkApp { drv = adnix; };
apps.default = flake-utils.lib.mkApp {drv = adnix;};
devShells.default = pkgs.mkShell {
inputsFrom = builtins.attrValues self.checks;
devShells.default = pkgs.mkShell {
inputsFrom = builtins.attrValues self.checks;
nativeBuildInputs = with pkgs; [
cargo-nextest
cargo-release
rustStable
];
};
});
nativeBuildInputs = with pkgs; [
cargo-nextest
cargo-release
rustStable
];
};
});
}

View File

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