switch to treefmt

This commit is contained in:
Shelvacu
2024-12-08 13:25:55 -08:00
committed by Shelvacu on fw
parent 164c402ca0
commit 7491e35ef3
3 changed files with 32 additions and 12 deletions

21
flake.lock generated
View File

@@ -1543,6 +1543,7 @@
"padtype-unstable": "padtype-unstable",
"sm64baserom": "sm64baserom",
"sops-nix": "sops-nix",
"treefmt-nix": "treefmt-nix_3",
"vscode-server": "vscode-server",
"vscode-server-unstable": "vscode-server-unstable"
}
@@ -1845,6 +1846,26 @@
"type": "github"
}
},
"treefmt-nix_3": {
"inputs": {
"nixpkgs": [
"nixpkgs-unstable"
]
},
"locked": {
"lastModified": 1733662930,
"narHash": "sha256-9qOp6jNdezzLMxwwXaXZWPXosHbNqno+f7Ii/xftqZ8=",
"owner": "numtide",
"repo": "treefmt-nix",
"rev": "357cda84af1d74626afb7fb3bc12d6957167cda9",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "treefmt-nix",
"type": "github"
}
},
"treefmt_2": {
"inputs": {
"nixpkgs": [

View File

@@ -98,6 +98,10 @@
url = "git+https://git.lix.systems/lix-project/nixos-module.git?ref=stable";
inputs.nixpkgs.follows = "nixpkgs-unstable";
};
treefmt-nix = {
url = "github:numtide/treefmt-nix";
inputs.nixpkgs.follows = "nixpkgs-unstable";
};
};
outputs =
@@ -395,20 +399,10 @@
pkgs-stable = import inputs.nixpkgs nixpkgs-args;
_plain = mkPlain pkgs-unstable;
plain = _plain.config.vacu.withAsserts _plain;
treefmtEval = inputs.treefmt-nix.lib.evalModule pkgs-unstable ./treefmt.nix;
in
# dnsModule = lib.evalModules {
# modules = [
# {
# config._module.check = false;
# options.vacu.dns = lib.mkOption {
# default = { };
# type = lib.types.attrsOf inputs.dns.lib.types.zone;
# };
# }
# ];
# };
{
formatter = pkgs-unstable.nixfmt-rfc-style;
formatter = treefmtEval.config.build.wrapper;
apps.sops = {
type = "app";
program = lib.getExe self.packages.${system}.wrappedSops;

5
treefmt.nix Normal file
View File

@@ -0,0 +1,5 @@
{ ... }:
{
projectRootFile = "flake.nix";
programs.nixfmt-rfc-style.enable = true;
}