Some checks failed
Publish Docker Images / coverage-and-sonar (push) Failing after 28m17s
80 lines
2.5 KiB
Nix
80 lines
2.5 KiB
Nix
{
|
|
description = "Conventional commits for Jujutsu";
|
|
|
|
inputs = {
|
|
nixpkgs.url = "github:cachix/devenv-nixpkgs/rolling";
|
|
flake-utils.url = "github:numtide/flake-utils";
|
|
alejandra = {
|
|
url = "github:kamadorueda/alejandra/4.0.0";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
devenv = {
|
|
url = "github:cachix/devenv";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
rust-overlay = {
|
|
url = "github:oxalica/rust-overlay";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
};
|
|
|
|
nixConfig = {
|
|
extra-trusted-public-keys = [ "devenv.cachix.org-1:w1cLUi8dv3hnoSPGAuibQv+f9TZLr6cv/Hm9XgU50cw=" ];
|
|
extra-substituters = [ "https://devenv.cachix.org" ];
|
|
};
|
|
|
|
outputs = {
|
|
nixpkgs,
|
|
flake-utils,
|
|
rust-overlay,
|
|
alejandra,
|
|
...
|
|
} @ inputs:
|
|
flake-utils.lib.eachDefaultSystem (
|
|
system: let
|
|
overlays = [(import rust-overlay)];
|
|
pkgs = import nixpkgs {inherit system overlays;};
|
|
rustVersion = pkgs.rust-bin.stable.latest.default;
|
|
rustPlatform = pkgs.makeRustPlatform {
|
|
cargo = rustVersion;
|
|
rustc = rustVersion;
|
|
};
|
|
in {
|
|
formatter = alejandra.defaultPackage.${system};
|
|
packages =
|
|
(import ./nix/package.nix {inherit pkgs rustPlatform;})
|
|
// {
|
|
windows = let
|
|
mingwPkgs = pkgs.pkgsCross.mingwW64;
|
|
rustWindows = pkgs.rust-bin.stable.latest.default.override {
|
|
targets = ["x86_64-pc-windows-gnu"];
|
|
};
|
|
rustPlatformWindows = mingwPkgs.makeRustPlatform {
|
|
cargo = rustWindows;
|
|
rustc = rustWindows;
|
|
};
|
|
cargoToml = builtins.fromTOML (builtins.readFile ./Cargo.toml);
|
|
in
|
|
rustPlatformWindows.buildRustPackage {
|
|
pname = cargoToml.package.name;
|
|
version = cargoToml.package.version;
|
|
src = pkgs.lib.cleanSource ./.;
|
|
cargoLock.lockFile = ./Cargo.lock;
|
|
nativeBuildInputs = [pkgs.upx];
|
|
doCheck = false;
|
|
meta = {
|
|
description = "Conventional commits for Jujutsu";
|
|
homepage = "https://labs.phundrak.com/phundrak/jj-cz";
|
|
};
|
|
postBuild = ''
|
|
${pkgs.upx}/bin/upx target/*/release/jj-cz.exe
|
|
'';
|
|
};
|
|
};
|
|
devShell = import ./nix/shell.nix {
|
|
inherit inputs pkgs rustVersion;
|
|
};
|
|
}
|
|
);
|
|
}
|