diff --git a/flake.lock b/flake.lock index d8db8db2..2b883b6e 100644 --- a/flake.lock +++ b/flake.lock @@ -16,6 +16,24 @@ "type": "github" } }, + "flake-parts": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib" + }, + "locked": { + "lastModified": 1715865404, + "narHash": "sha256-/GJvTdTpuDjNn84j82cU6bXztE0MSkdnTWClUCRub78=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "8dc45382d5206bd292f9c2768b8058a8fd8311d9", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 1716293225, @@ -32,44 +50,23 @@ "type": "github" } }, + "nixpkgs-lib": { + "locked": { + "lastModified": 1714640452, + "narHash": "sha256-QBx10+k6JWz6u7VsohfSw8g8hjdBZEf8CFzXH1/1Z94=", + "type": "tarball", + "url": "https://github.com/NixOS/nixpkgs/archive/50eb7ecf4cd0a5756d7275c8ba36790e5bd53e33.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://github.com/NixOS/nixpkgs/archive/50eb7ecf4cd0a5756d7275c8ba36790e5bd53e33.tar.gz" + } + }, "root": { "inputs": { "flake-compat": "flake-compat", - "nixpkgs": "nixpkgs", - "utils": "utils" - } - }, - "systems": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - }, - "utils": { - "inputs": { - "systems": "systems" - }, - "locked": { - "lastModified": 1710146030, - "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" + "flake-parts": "flake-parts", + "nixpkgs": "nixpkgs" } } }, diff --git a/flake.nix b/flake.nix index dba647fe..4a2d3c4c 100644 --- a/flake.nix +++ b/flake.nix @@ -4,7 +4,7 @@ inputs = { nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; - utils.url = "github:numtide/flake-utils"; + flake-parts.url = "github:hercules-ci/flake-parts"; flake-compat = { url = "github:edolstra/flake-compat"; @@ -13,24 +13,41 @@ }; outputs = - { nixpkgs, utils, ... }: - utils.lib.eachDefaultSystem ( - system: - let - pkgs = import nixpkgs { inherit system; }; - in - rec { - packages.default = packages.bcachefs-tools; - packages.bcachefs-tools = pkgs.callPackage ./build.nix { }; - packages.bcachefs-tools-fuse = packages.bcachefs-tools.override { fuseSupport = true; }; + inputs@{ + self, + nixpkgs, + flake-parts, + flake-compat, + ... + }: + flake-parts.lib.mkFlake { inherit inputs; } { + # can be extended, but these have proper binary cache support in nixpkgs + # as of writing. + systems = [ + "aarch64-linux" + "x86_64-linux" + ]; - formatter = pkgs.nixfmt-rfc-style; + perSystem = + { + self', + config, + pkgs, + ... + }: + { + packages.default = config.packages.bcachefs-tools; + packages.bcachefs-tools = pkgs.callPackage ./build.nix { }; - devShells.default = pkgs.mkShell { - inputsFrom = [ packages.default ]; + packages.bcachefs-tools-fuse = config.packages.bcachefs-tools.override { fuseSupport = true; }; - LIBCLANG_PATH = "${pkgs.clang.cc.lib}/lib"; + formatter = pkgs.nixfmt-rfc-style; + + devShells.default = pkgs.mkShell { + inputsFrom = [ config.packages.default ]; + + LIBCLANG_PATH = "${pkgs.clang.cc.lib}/lib"; + }; }; - } - ); + }; }