]> git.sesse.net Git - bcachefs-tools-debian/blobdiff - flake.nix
nix: fix build add overlay and formatter to flake
[bcachefs-tools-debian] / flake.nix
index 0f8e90d26dcc3337e1adc33b5d0b5ed2efb9576b..bdaa4bfdb55f7379cc4dea18cc63cc72c58a08ea 100644 (file)
--- a/flake.nix
+++ b/flake.nix
   };
 
   outputs = { self, nixpkgs, utils, ... }:
-    utils.lib.eachDefaultSystem (system:
+    {
+      overlays.default = final: prev: {
+        bcachefs = final.callPackage ./build.nix { };
+      };
+    } // utils.lib.eachDefaultSystem (system:
       let
-        pkgs = nixpkgs.legacyPackages.${system};
-        bcachefs = pkgs.callPackage ./build.nix {};
+        pkgs = import nixpkgs {
+          inherit system;
+          overlays = [ self.overlays.default ];
+        };
       in {
         packages = {
-          default = bcachefs;
+          inherit (pkgs) bcachefs;
+          default = pkgs.bcachefs;
         };
+
+        formatter = pkgs.nixfmt;
       });
 }