nix fmt: automatically expose the default nix formatter
This commit is contained in:
parent
72f2a2ddc0
commit
1b5b697dfb
3 changed files with 27 additions and 2 deletions
22
flake.lock
generated
22
flake.lock
generated
|
|
@ -1,6 +1,26 @@
|
||||||
{
|
{
|
||||||
"nodes": {
|
"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",
|
"root": "root",
|
||||||
"version": 7
|
"version": 7
|
||||||
|
|
|
||||||
|
|
@ -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 ./.;
|
outputs = { self, ... }@inputs: import ./lib/flake.nix inputs ./.;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,9 @@ let
|
||||||
convert = attr: value: value self inputs imports;
|
convert = attr: value: value self inputs imports;
|
||||||
|
|
||||||
result = (builtins.mapAttrs convert schema.exports);
|
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
|
flake = { imports?{}, exports?{}, base?[] }@schema'old: { ... }@inputs'old: { ... }@imports'old: { ... }@inputs'new: base: let
|
||||||
schema = {
|
schema = {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue