2021-10-14 17:19:36 +03:00
|
|
|
{
|
2022-11-25 02:47:29 +03:00
|
|
|
description = "Userspace tools for bcachefs";
|
|
|
|
|
2024-05-22 21:43:43 +03:00
|
|
|
inputs = {
|
|
|
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
|
|
|
|
2024-05-22 22:08:09 +03:00
|
|
|
flake-parts.url = "github:hercules-ci/flake-parts";
|
2024-05-22 21:43:43 +03:00
|
|
|
|
2024-05-22 22:35:41 +03:00
|
|
|
treefmt-nix = {
|
|
|
|
url = "github:numtide/treefmt-nix";
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
|
|
|
|
2024-05-27 18:04:24 +03:00
|
|
|
fenix = {
|
|
|
|
url = "github:nix-community/fenix";
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
|
|
|
|
2024-05-22 21:43:43 +03:00
|
|
|
flake-compat = {
|
|
|
|
url = "github:edolstra/flake-compat";
|
|
|
|
flake = false;
|
|
|
|
};
|
2022-11-25 02:47:29 +03:00
|
|
|
};
|
|
|
|
|
2024-05-22 21:41:19 +03:00
|
|
|
outputs =
|
2024-05-22 22:08:09 +03:00
|
|
|
inputs@{
|
|
|
|
self,
|
|
|
|
nixpkgs,
|
|
|
|
flake-parts,
|
2024-05-22 22:35:41 +03:00
|
|
|
treefmt-nix,
|
2024-05-27 18:04:24 +03:00
|
|
|
fenix,
|
2024-05-22 22:08:09 +03:00
|
|
|
flake-compat,
|
|
|
|
...
|
|
|
|
}:
|
|
|
|
flake-parts.lib.mkFlake { inherit inputs; } {
|
2024-05-22 22:35:41 +03:00
|
|
|
imports = [ inputs.treefmt-nix.flakeModule ];
|
|
|
|
|
2024-05-22 22:08:09 +03:00
|
|
|
# can be extended, but these have proper binary cache support in nixpkgs
|
|
|
|
# as of writing.
|
|
|
|
systems = [
|
|
|
|
"aarch64-linux"
|
|
|
|
"x86_64-linux"
|
|
|
|
];
|
|
|
|
|
|
|
|
perSystem =
|
|
|
|
{
|
|
|
|
self',
|
|
|
|
config,
|
|
|
|
pkgs,
|
2024-05-27 18:04:24 +03:00
|
|
|
system,
|
2024-05-22 22:08:09 +03:00
|
|
|
...
|
|
|
|
}:
|
2024-05-27 18:04:24 +03:00
|
|
|
let
|
|
|
|
rustfmtToml = builtins.fromTOML (builtins.readFile ./rustfmt.toml);
|
|
|
|
in
|
2024-05-22 22:08:09 +03:00
|
|
|
{
|
|
|
|
packages.default = config.packages.bcachefs-tools;
|
|
|
|
packages.bcachefs-tools = pkgs.callPackage ./build.nix { };
|
|
|
|
|
|
|
|
packages.bcachefs-tools-fuse = config.packages.bcachefs-tools.override { fuseSupport = true; };
|
|
|
|
|
|
|
|
devShells.default = pkgs.mkShell {
|
2024-05-22 22:35:41 +03:00
|
|
|
inputsFrom = [
|
|
|
|
config.packages.default
|
|
|
|
config.treefmt.build.devShell
|
|
|
|
];
|
2024-05-22 22:08:09 +03:00
|
|
|
|
|
|
|
LIBCLANG_PATH = "${pkgs.clang.cc.lib}/lib";
|
2024-05-22 22:42:26 +03:00
|
|
|
|
|
|
|
# here go packages that aren't required for builds but are used for
|
|
|
|
# development, and might need to be version matched with build
|
|
|
|
# dependencies (e.g. clippy or rust-analyzer).
|
|
|
|
packages = with pkgs; [
|
|
|
|
cargo-audit
|
|
|
|
cargo-outdated
|
|
|
|
clang-tools
|
|
|
|
clippy
|
|
|
|
rust-analyzer
|
|
|
|
];
|
2024-05-22 22:08:09 +03:00
|
|
|
};
|
2024-05-22 22:35:41 +03:00
|
|
|
|
|
|
|
treefmt.config = {
|
|
|
|
projectRootFile = "flake.nix";
|
|
|
|
|
|
|
|
programs = {
|
|
|
|
nixfmt-rfc-style.enable = true;
|
2024-05-27 18:04:24 +03:00
|
|
|
rustfmt.edition = rustfmtToml.edition;
|
|
|
|
rustfmt.enable = true;
|
|
|
|
rustfmt.package = fenix.packages.${system}.default.rustfmt;
|
2024-05-22 22:35:41 +03:00
|
|
|
};
|
|
|
|
};
|
2024-05-22 21:51:00 +03:00
|
|
|
};
|
2024-05-22 22:08:09 +03:00
|
|
|
};
|
2021-10-14 17:19:36 +03:00
|
|
|
}
|