mirror of
https://github.com/msfjarvis/gitice
synced 2025-08-14 10:37:01 +05:30
chore: reformat all files with nixfmt-rfc-style
This commit is contained in:
parent
bd500e2a08
commit
a7b12817bf
3 changed files with 103 additions and 82 deletions
11
default.nix
11
default.nix
|
@ -1,8 +1,9 @@
|
||||||
(import (let
|
(import (
|
||||||
lock = builtins.fromJSON (builtins.readFile ./flake.lock);
|
let
|
||||||
in
|
lock = builtins.fromJSON (builtins.readFile ./flake.lock);
|
||||||
|
in
|
||||||
fetchTarball {
|
fetchTarball {
|
||||||
url = "https://github.com/nix-community/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz";
|
url = "https://github.com/nix-community/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz";
|
||||||
sha256 = lock.nodes.flake-compat.locked.narHash;
|
sha256 = lock.nodes.flake-compat.locked.narHash;
|
||||||
}) {src = ./.;})
|
}
|
||||||
.defaultNix
|
) { src = ./.; }).defaultNix
|
||||||
|
|
163
flake.nix
163
flake.nix
|
@ -22,77 +22,96 @@
|
||||||
inputs.flake-compat.url = "github:nix-community/flake-compat";
|
inputs.flake-compat.url = "github:nix-community/flake-compat";
|
||||||
inputs.flake-compat.flake = false;
|
inputs.flake-compat.flake = false;
|
||||||
|
|
||||||
outputs = {
|
outputs =
|
||||||
nixpkgs,
|
{
|
||||||
advisory-db,
|
nixpkgs,
|
||||||
crane,
|
advisory-db,
|
||||||
devshell,
|
crane,
|
||||||
fenix,
|
devshell,
|
||||||
flake-utils,
|
fenix,
|
||||||
...
|
flake-utils,
|
||||||
}:
|
...
|
||||||
flake-utils.lib.eachDefaultSystem (system: let
|
}:
|
||||||
pkgs = import nixpkgs {
|
flake-utils.lib.eachDefaultSystem (
|
||||||
inherit system;
|
system:
|
||||||
overlays = [devshell.overlays.default];
|
let
|
||||||
};
|
pkgs = import nixpkgs {
|
||||||
|
inherit system;
|
||||||
rustNightly = (import fenix {inherit pkgs;}).fromToolchainFile {
|
overlays = [ devshell.overlays.default ];
|
||||||
file = ./rust-toolchain.toml;
|
};
|
||||||
sha256 = "sha256-XPGNBesOSwZJCXgynlavqa5QdsTAnodTmbx6t6XUWsY=";
|
|
||||||
};
|
rustNightly = (import fenix { inherit pkgs; }).fromToolchainFile {
|
||||||
|
file = ./rust-toolchain.toml;
|
||||||
craneLib = (crane.mkLib pkgs).overrideToolchain rustNightly;
|
sha256 = "sha256-XPGNBesOSwZJCXgynlavqa5QdsTAnodTmbx6t6XUWsY=";
|
||||||
src = craneLib.cleanCargoSource ./.;
|
};
|
||||||
nativeBuildInputs = [];
|
|
||||||
buildInputs = [];
|
craneLib = (crane.mkLib pkgs).overrideToolchain rustNightly;
|
||||||
cargoArtifacts = craneLib.buildDepsOnly {
|
src = craneLib.cleanCargoSource ./.;
|
||||||
inherit src buildInputs nativeBuildInputs;
|
nativeBuildInputs = [ ];
|
||||||
};
|
buildInputs = [ ];
|
||||||
|
cargoArtifacts = craneLib.buildDepsOnly {
|
||||||
commonArgs = {
|
inherit src buildInputs nativeBuildInputs;
|
||||||
inherit src cargoArtifacts buildInputs nativeBuildInputs;
|
};
|
||||||
cargoClippyExtraArgs = "--all-targets -- --deny warnings";
|
|
||||||
};
|
commonArgs = {
|
||||||
|
inherit
|
||||||
gitice = craneLib.buildPackage (commonArgs // {doCheck = false;});
|
src
|
||||||
gitice-clippy = craneLib.cargoClippy (commonArgs // {});
|
cargoArtifacts
|
||||||
gitice-fmt = craneLib.cargoFmt (commonArgs // {});
|
buildInputs
|
||||||
gitice-audit =
|
nativeBuildInputs
|
||||||
craneLib.cargoAudit (commonArgs // {inherit advisory-db;});
|
;
|
||||||
gitice-nextest = craneLib.cargoNextest (commonArgs
|
cargoClippyExtraArgs = "--all-targets -- --deny warnings";
|
||||||
// {
|
};
|
||||||
partitions = 1;
|
|
||||||
partitionType = "count";
|
gitice = craneLib.buildPackage (commonArgs // { doCheck = false; });
|
||||||
});
|
gitice-clippy = craneLib.cargoClippy (commonArgs // { });
|
||||||
in {
|
gitice-fmt = craneLib.cargoFmt (commonArgs // { });
|
||||||
checks = {
|
gitice-audit = craneLib.cargoAudit (commonArgs // { inherit advisory-db; });
|
||||||
inherit gitice gitice-audit gitice-clippy gitice-fmt gitice-nextest;
|
gitice-nextest = craneLib.cargoNextest (
|
||||||
};
|
commonArgs
|
||||||
|
// {
|
||||||
packages.default = gitice;
|
partitions = 1;
|
||||||
|
partitionType = "count";
|
||||||
apps.default = flake-utils.lib.mkApp {drv = gitice;};
|
|
||||||
|
|
||||||
devShells.default = pkgs.devshell.mkShell {
|
|
||||||
bash = {interactive = "";};
|
|
||||||
|
|
||||||
env = [
|
|
||||||
{
|
|
||||||
name = "DEVSHELL_NO_MOTD";
|
|
||||||
value = 1;
|
|
||||||
}
|
}
|
||||||
];
|
);
|
||||||
|
in
|
||||||
packages = with pkgs; [
|
{
|
||||||
cargo-dist
|
checks = {
|
||||||
cargo-nextest
|
inherit
|
||||||
cargo-release
|
gitice
|
||||||
fenix.packages.${system}.rust-analyzer
|
gitice-audit
|
||||||
git-cliff
|
gitice-clippy
|
||||||
rustNightly
|
gitice-fmt
|
||||||
stdenv.cc
|
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
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
11
shell.nix
11
shell.nix
|
@ -1,8 +1,9 @@
|
||||||
(import (let
|
(import (
|
||||||
lock = builtins.fromJSON (builtins.readFile ./flake.lock);
|
let
|
||||||
in
|
lock = builtins.fromJSON (builtins.readFile ./flake.lock);
|
||||||
|
in
|
||||||
fetchTarball {
|
fetchTarball {
|
||||||
url = "https://github.com/nix-community/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz";
|
url = "https://github.com/nix-community/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz";
|
||||||
sha256 = lock.nodes.flake-compat.locked.narHash;
|
sha256 = lock.nodes.flake-compat.locked.narHash;
|
||||||
}) {src = ./.;})
|
}
|
||||||
.shellNix
|
) { src = ./.; }).shellNix
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue