mfgames-conventional-commit-rs/flake.nix

82 lines
2.4 KiB
Nix
Raw Normal View History

2024-03-09 07:00:57 +00:00
{
inputs = {
nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/*.tar.gz";
mfgames-project-setup.url = "git+https://src.mfgames.com/nixos-contrib/mfgames-project-setup-flake.git";
2024-03-10 04:51:46 +00:00
systems.url = "github:nix-systems/x86_64-linux";
flake-utils.url = "github:numtide/flake-utils";
flake-utils.inputs.systems.follows = "systems";
fenix = {
url = "github:nix-community/fenix";
inputs.nixpkgs.follows = "nixpkgs";
};
2024-03-09 07:00:57 +00:00
};
2024-03-10 04:51:46 +00:00
outputs = inputs @ { self, nixpkgs, mfgames-project-setup, flake-utils, fenix, ... }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
rustPlatform = (pkgs.makeRustPlatform {
inherit (fenix.packages.${system}.minimal) cargo rustc;
});
in
{
# Create a binary for the project.
packages = rec {
mfgames-conventional-commit = rustPlatform.buildRustPackage {
pname = "mfgames-conventional-commit";
version = "0.0.1";
src = ./.;
#cargoBuildFlags = "-p app";
cargoLock = {
lockFile = ./Cargo.lock;
};
nativeBuildInputs = [ pkgs.pkg-config ];
PKG_CONFIG_PATH = "${pkgs.openssl.dev}/lib/pkgconfig";
2024-03-09 07:00:57 +00:00
};
2024-03-10 04:51:46 +00:00
default = mfgames-conventional-commit;
};
apps = rec {
mfgames-conventional-commit = flake-utils.lib.mkApp { drv = self.packages.${system}.mfgames-conventional-commit; };
default = mfgames-conventional-commit;
};
# Set up the developer shell.
devShells =
let
project-config = mfgames-project-setup.lib.mkConfig {
inherit system pkgs;
contributorCovenant.enable = true;
contributorCovenant.contact = "contact@mfgames.com";
developerCertificateOfOrigin.enable = true;
rust.enable = true;
};
in
{
# Shell
default = pkgs.mkShell {
packages = [
# Rust
pkgs.rustup
# git2 crate
pkgs.pkg-config
pkgs.openssl
]
++ project-config.packages;
shellHook = project-config.shellHook;
};
2024-03-09 07:00:57 +00:00
};
2024-03-10 04:51:46 +00:00
# Formatting for the Nix files
formatter = pkgs.nixpkgs-fmt;
});
2024-03-09 07:00:57 +00:00
}