2021-10-14 17:19:36 +03:00
|
|
|
{
|
|
|
|
description = "Userspace tools for bcachefs";
|
|
|
|
|
|
|
|
# Nixpkgs / NixOS version to use.
|
|
|
|
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
|
|
|
inputs.utils.url = "github:numtide/flake-utils";
|
|
|
|
inputs.filter.url = "github:numtide/nix-filter";
|
|
|
|
|
|
|
|
outputs = { self, nixpkgs, utils, filter, ... }@inputs:
|
|
|
|
let
|
|
|
|
# System types to support.
|
|
|
|
supportedSystems = [ "x86_64-linux" ];
|
|
|
|
in
|
|
|
|
{
|
|
|
|
version = "${builtins.substring 0 8 self.lastModifiedDate}-${self.shortRev or "dirty"}";
|
|
|
|
|
|
|
|
overlay = import ./nix/overlay.nix inputs;
|
2021-10-19 22:26:41 +03:00
|
|
|
nixosModule = self.nixosModules.bcachefs;
|
|
|
|
nixosModules.bcachefs = import ./rust-src/mount/module.nix;
|
|
|
|
nixosModules.bcachefs-enable-boot = ({config, pkgs, lib, ... }:{
|
|
|
|
# Disable Upstream NixOS Module when this is in use
|
|
|
|
disabledModules = [ "tasks/filesystems/bcachefs.nix" ];
|
|
|
|
# Import needed packages
|
|
|
|
nixpkgs.overlays = [ self.overlay ];
|
|
|
|
|
|
|
|
# Add bcachefs to boot and kernel
|
|
|
|
boot.initrd.supportedFilesystems = [ "bcachefs" ];
|
|
|
|
boot.supportedFilesystems = [ "bcachefs" ];
|
|
|
|
});
|
2021-10-14 17:19:36 +03:00
|
|
|
}
|
|
|
|
// utils.lib.eachSystem supportedSystems (system:
|
|
|
|
let pkgs = import nixpkgs {
|
|
|
|
inherit system;
|
|
|
|
overlays = [ self.overlay ];
|
|
|
|
};
|
|
|
|
in rec {
|
|
|
|
|
|
|
|
# A Nixpkgs overlay.
|
|
|
|
|
|
|
|
# Provide some binary packages for selected system types.
|
|
|
|
defaultPackage = pkgs.bcachefs.tools;
|
|
|
|
packages = {
|
|
|
|
inherit (pkgs.bcachefs)
|
|
|
|
tools
|
|
|
|
toolsValgrind
|
|
|
|
toolsDebug
|
2021-10-18 20:27:51 +03:00
|
|
|
mount
|
|
|
|
bch_bindgen
|
2021-10-14 17:19:36 +03:00
|
|
|
kernel;
|
|
|
|
|
2021-10-18 20:27:51 +03:00
|
|
|
tools-musl = pkgs.pkgsMusl.bcachefs.tools;
|
|
|
|
mount-musl = pkgs.pkgsMusl.bcachefs.mount;
|
2021-10-14 17:19:36 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
checks = {
|
|
|
|
kernelSrc = packages.kernel.src;
|
|
|
|
inherit (packages)
|
2021-10-18 20:27:51 +03:00
|
|
|
mount
|
|
|
|
bch_bindgen
|
2021-10-14 17:19:36 +03:00
|
|
|
toolsValgrind;
|
|
|
|
};
|
|
|
|
|
|
|
|
devShell = devShells.tools;
|
|
|
|
devShells.tools = pkgs.bcachefs.tools.override { inShell = true; };
|
2021-10-19 22:30:45 +03:00
|
|
|
devShells.mount = pkgs.bcachefs.mount.override { inShell = true; };
|
2021-10-14 17:19:36 +03:00
|
|
|
});
|
|
|
|
}
|