]> git.sesse.net Git - bcachefs-tools-debian/blobdiff - flake.nix
Disable pristine-tar option in gbp.conf, since there is no pristine-tar branch.
[bcachefs-tools-debian] / flake.nix
index 146da4683ae50d4cc77efe08530138ecb0339cec..b8f9ce58d01f413fd2c6ca8dbfe47c6674e3b6b8 100644 (file)
--- a/flake.nix
+++ b/flake.nix
@@ -1,55 +1,40 @@
 {
-       description = "Userspace tools for bcachefs";
+  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";
+  # Nixpkgs / NixOS version to use.
+  inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
+  inputs.utils.url = "github:numtide/flake-utils";
+  inputs.flake-compat = {
+    url = "github:edolstra/flake-compat";
+    flake = false;
+  };
 
-       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"}";
+  outputs = { self, nixpkgs, utils, ... }:
+    {
+      overlays.default = final: prev: {
+        bcachefs = final.callPackage ./build.nix { };
+      };
+    } // utils.lib.eachDefaultSystem (system:
+      let
+        pkgs = import nixpkgs {
+          inherit system;
+          overlays = [ self.overlays.default ];
+        };
+      in {
+        packages = {
+          inherit (pkgs) bcachefs;
+          bcachefs-fuse = pkgs.bcachefs.override { fuseSupport = true; };
+          default = pkgs.bcachefs;
+        };
 
-                       overlay = import ./nix/overlay.nix inputs;
-               }
-               // utils.lib.eachSystem supportedSystems (system: 
-               let pkgs = import nixpkgs { 
-                       inherit system; 
-                       overlays = [ self.overlay ]; 
-               }; 
-               in rec {
-                       
-                       # A Nixpkgs overlay.
+        formatter = pkgs.nixfmt;
 
-                       # Provide some binary packages for selected system types.
-                       defaultPackage = pkgs.bcachefs.tools;
-                       packages = {
-                               inherit (pkgs.bcachefs)
-                                       tools
-                                       toolsValgrind
-                                       toolsDebug
-                                       mount
-                                       bch_bindgen
-                                       kernel;
-
-                               tools-musl = pkgs.pkgsMusl.bcachefs.tools;
-                               mount-musl = pkgs.pkgsMusl.bcachefs.mount;
-                       };
-
-                       checks = { 
-                               kernelSrc = packages.kernel.src;
-                               inherit (packages) 
-                                       mount
-                                       bch_bindgen
-                                       toolsValgrind;
-                       };
-
-                       devShell = devShells.tools;
-                       devShells.tools = pkgs.bcachefs.tools.override { inShell = true; };
-                       devShells.mount = pkgs.bcachefs.mount.override { inShell = true; };
-               });
+        devShells.default = pkgs.callPackage ({ mkShell, rustc, cargo, gnumake
+          , gcc, clang, pkg-config, libuuid, libsodium, keyutils, liburcu, zlib
+          , libaio, zstd, lz4, udev, bcachefs }:
+          mkShell {
+            LIBCLANG_PATH = "${clang.cc.lib}/lib";
+            inherit (bcachefs) nativeBuildInputs buildInputs;
+          }) { };
+      });
 }