diff --git a/flake.lock b/flake.lock index 5999137..340835b 100644 --- a/flake.lock +++ b/flake.lock @@ -1,6 +1,26 @@ { "nodes": { - "root": {} + "nixpkgs": { + "locked": { + "lastModified": 1763966396, + "narHash": "sha256-6eeL1YPcY1MV3DDStIDIdy/zZCDKgHdkCmsrLJFiZf0=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "5ae3b07d8d6527c42f17c876e404993199144b6a", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } }, "root": "root", "version": 7 diff --git a/flake.nix b/flake.nix index 4c62af4..ee3f3c4 100644 --- a/flake.nix +++ b/flake.nix @@ -1,3 +1,6 @@ { + # only used for nixfmt-tree + inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + outputs = { self, ... }@inputs: import ./lib/flake.nix inputs ./.; } diff --git a/lib/flake.nix b/lib/flake.nix index 4655a5d..d208f47 100644 --- a/lib/flake.nix +++ b/lib/flake.nix @@ -11,7 +11,9 @@ let convert = attr: value: value self inputs imports; result = (builtins.mapAttrs convert schema.exports); - in result // { lib = lib // (result.lib or {}); }; + in { + formatter = builtins.mapAttrs (_: pkgs: pkgs.nixfmt-tree) inputs.nixpkgs.legacyPackages; + } // result // { lib = lib // (result.lib or {}); }; flake = { imports?{}, exports?{}, base?[] }@schema'old: { ... }@inputs'old: { ... }@imports'old: { ... }@inputs'new: base: let schema = {