34 lines
1.0 KiB
Nix
34 lines
1.0 KiB
Nix
{
|
|
description = "A flake for building sysmon.";
|
|
|
|
inputs = {
|
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
|
|
|
flake-utils.url = "github:numtide/flake-utils";
|
|
|
|
treefmt-nix.url = "github:numtide/treefmt-nix";
|
|
treefmt-nix.inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
|
|
outputs = { self, nixpkgs, flake-utils, treefmt-nix, ... }@inputs:
|
|
flake-utils.lib.eachDefaultSystem (system:
|
|
let
|
|
pkgs = nixpkgs.legacyPackages.${system};
|
|
cargoToml = builtins.fromTOML (builtins.readFile ./Cargo.toml);
|
|
treefmtEval = treefmt-nix.lib.evalModule pkgs (pkgs: {
|
|
projectRootFile = "flake.nix";
|
|
programs.rustfmt.enable = true;
|
|
programs.nixfmt.enable = true;
|
|
});
|
|
in {
|
|
packages.default = pkgs.rustPlatform.buildRustPackage {
|
|
inherit (cargoToml.package) name version;
|
|
src = ./.;
|
|
cargoLock.lockFile = ./Cargo.lock;
|
|
};
|
|
|
|
formatter = treefmtEval.config.build.wrapper;
|
|
checks.formatting = treefmtEval.config.build.check self;
|
|
});
|
|
}
|